diff --git a/.github/workflows/reusable-unit-tests.yml b/.github/workflows/reusable-unit-tests.yml index 0467c644cf2b..06a48362c404 100644 --- a/.github/workflows/reusable-unit-tests.yml +++ b/.github/workflows/reusable-unit-tests.yml @@ -59,12 +59,15 @@ jobs: with: fetch-depth: 0 - # skip the "cache: maven" step from setup-jave since we restore it below + # skip the "cache: maven" step from setup-java. We explicitly use a + # different cache key since we cannot reuse it across commits. - uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: ${{ inputs.jdk }} + # the build step produces SNAPSHOT artifacts into the local maven repository, + # we include github.sha in the cache key to make it specific to that build/jdk - name: Restore Maven repository id: maven-restore uses: actions/cache/restore@v3 diff --git a/.github/workflows/standard-its.yml b/.github/workflows/standard-its.yml index 2648dc0993b6..ae78a1f2a836 100644 --- a/.github/workflows/standard-its.yml +++ b/.github/workflows/standard-its.yml @@ -153,6 +153,8 @@ jobs: - name: Setup java run: export JAVA_HOME=$JAVA_HOME_8_X64 + # the build step produces SNAPSHOT artifacts into the local maven repository, + # we include github.sha in the cache key to make it specific to that build/jdk - name: Restore Maven repository id: maven-restore uses: actions/cache/restore@v3 diff --git a/.github/workflows/unit-and-integration-tests-unified.yml b/.github/workflows/unit-and-integration-tests-unified.yml index aa929ed2cadf..d834143695d3 100644 --- a/.github/workflows/unit-and-integration-tests-unified.yml +++ b/.github/workflows/unit-and-integration-tests-unified.yml @@ -62,11 +62,15 @@ jobs: - name: Checkout branch uses: actions/checkout@v3 + # skip the "cache: maven" step from setup-java. We explicitly use a + # different cache key since we cannot reuse it across commits. - uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: ${{ matrix.jdk }} + # the build step produces SNAPSHOT artifacts into the local maven repository, + # we include github.sha in the cache key to make it specific to that build/jdk - name: Cache Maven m2 repository id: maven uses: actions/cache@v3