From 021f934f23b6721ecc86c984cdf21eccff52a802 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Wed, 10 Jan 2024 14:14:23 -0500 Subject: [PATCH 1/4] 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. --- .github/workflows/graalvm.yml | 5 +++++ .github/workflows/maven.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index a4418382..a77bfd5a 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -56,3 +56,8 @@ 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: ${{ always() }} + run: rm -rvf ~/.m2/repository/gg/jte/ diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f712d59a..0c776dfc 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -63,6 +63,11 @@ 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: ${{ always() }} + run: rm -rvf ~/.m2/repository/gg/jte/ + coverage: # Do not run coverage for forks since they cannot upload From f859cb040b340544e8645cea92cdbd5c1d73acb6 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Wed, 10 Jan 2024 16:43:52 -0500 Subject: [PATCH 2/4] ci: fix rm for windows --- .github/workflows/graalvm.yml | 2 +- .github/workflows/maven.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index a77bfd5a..ae0de980 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -60,4 +60,4 @@ jobs: # This prevents local published artifacts from be added to GH Actions cache - name: Clean local artifacts if: ${{ always() }} - run: rm -rvf ~/.m2/repository/gg/jte/ + run: rm -r -f ~/.m2/repository/gg/jte diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0c776dfc..3d9595ff 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -66,7 +66,7 @@ jobs: # This prevents local published artifacts from be added to GH Actions cache - name: Clean local artifacts if: ${{ always() }} - run: rm -rvf ~/.m2/repository/gg/jte/ + run: rm -r -f ~/.m2/repository/gg/jte coverage: From 3a340e2a9c986497bd2528729354b7b8e840ace6 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Tue, 16 Jan 2024 09:58:34 -0500 Subject: [PATCH 3/4] ci: have separated steps for Windows and other OSes --- .github/workflows/graalvm.yml | 8 +++++++- .github/workflows/maven.yml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index ae0de980..707cf77c 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -59,5 +59,11 @@ jobs: # This prevents local published artifacts from be added to GH Actions cache - name: Clean local artifacts - if: ${{ always() }} + if: contains(matrix.os, 'win') == false run: rm -r -f ~/.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 \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3d9595ff..5aa2db27 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -65,9 +65,15 @@ jobs: # This prevents local published artifacts from be added to GH Actions cache - name: Clean local artifacts - if: ${{ always() }} + if: contains(matrix.os, 'win') == false run: rm -r -f ~/.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 From cd410f2166c8494fd192f7d5c287700513e6864b Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Tue, 16 Jan 2024 10:08:03 -0500 Subject: [PATCH 4/4] ci: make rm verbose --- .github/workflows/graalvm.yml | 2 +- .github/workflows/maven.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index 707cf77c..dece32d6 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -60,7 +60,7 @@ jobs: # This prevents local published artifacts from be added to GH Actions cache - name: Clean local artifacts if: contains(matrix.os, 'win') == false - run: rm -r -f ~/.m2/repository/gg/jte + 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). diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 5aa2db27..0bf70a00 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -66,7 +66,7 @@ jobs: # This prevents local published artifacts from be added to GH Actions cache - name: Clean local artifacts if: contains(matrix.os, 'win') == false - run: rm -r -f ~/.m2/repository/gg/jte + 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).