Skip to content

Commit

Permalink
ci: Do not cache locally published artifacts (#316)
Browse files Browse the repository at this point in the history
* ci: Do not cache locally published artifacts

These workflows publish artifacts to local maven repository, which are
then cached by GH Actions. Removing them at the end of the workflow
prevents them to pollute the cache.

* ci: fix rm for windows

* ci: have separated steps for Windows and other OSes

* ci: make rm verbose
  • Loading branch information
marcospereira committed Jan 16, 2024
1 parent 7ad2e12 commit de6880b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,14 @@ jobs:
- name: Stop Gradle Daemon
if: ${{ always() }}
run: cd test/jte-runtime-cp-test-gradle-convention && ./gradlew --stop

# This prevents local published artifacts from be added to GH Actions cache
- name: Clean local artifacts
if: contains(matrix.os, 'win') == false
run: rm -rvf ~/.m2/repository/gg/jte

# `rm` syntax for Windows is different. Needs to use `-Force` since `-f`
# is ambiguous (possible matches include: -Filter -Force).
- name: "[Windows]: Clean local artifacts"
if: contains(matrix.os, 'win')
run: rm -r -Force ~/.m2/repository/gg/jte
11 changes: 11 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ jobs:
name: failing-test-report
path: test/gradle-test-wrapper/build/reports/tests/test/**/*

# This prevents local published artifacts from be added to GH Actions cache
- name: Clean local artifacts
if: contains(matrix.os, 'win') == false
run: rm -rvf ~/.m2/repository/gg/jte

# `rm` syntax for Windows is different. Needs to use `-Force` since `-f`
# is ambiguous (possible matches include: -Filter -Force).
- name: "[Windows]: Clean local artifacts"
if: contains(matrix.os, 'win')
run: rm -r -Force ~/.m2/repository/gg/jte


coverage:
# Do not run coverage for forks since they cannot upload
Expand Down

0 comments on commit de6880b

Please sign in to comment.