From de6880be66ab5ff307834e4bc3aee941de35105e Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Tue, 16 Jan 2024 11:30:14 -0500 Subject: [PATCH] ci: Do not cache locally published artifacts (#316) * 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 --- .github/workflows/graalvm.yml | 11 +++++++++++ .github/workflows/maven.yml | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index a4418382..dece32d6 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f712d59a..0bf70a00 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -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