Moving to SHA based cache key (#13751)

Co-authored-by: Elliott Freis <elliottfreis@Elliott-Freis.earth.dynamic.blacklight.net>
This commit is contained in:
Elliott Freis 2023-02-03 15:49:17 -08:00 committed by GitHub
parent bea18dc9e4
commit c06631037d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 22 deletions

View File

@ -54,7 +54,14 @@ jobs:
with:
distribution: 'zulu'
java-version: ${{ inputs.build_jdk }}
cache: maven
- name: Restore Maven repository
id: maven-restore
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
key: maven-${{ runner.os }}-${{ inputs.build_jdk }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Retrieve cached docker image
uses: actions/cache/restore@v3
@ -63,6 +70,7 @@ jobs:
path: |
./druid-container-jdk${{ inputs.build_jdk }}.tar.gz
./integration-tests-ex/image/target/env.sh
fail-on-cache-miss: true
- name: Load docker image
run: |

View File

@ -72,8 +72,9 @@ jobs:
id: maven-restore
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
key: maven-${{ runner.os }}-${{ inputs.build_jdk }}-${{ hashFiles('**/pom.xml') }}
path: ~/.m2/repository
key: maven-${{ runner.os }}-${{ inputs.build_jdk }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Run IT
env:

View File

@ -64,7 +64,8 @@ jobs:
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
key: maven-${{ runner.os }}-${{ inputs.jdk }}-${{ hashFiles('**/pom.xml') }}
key: maven-${{ runner.os }}-${{ inputs.jdk }}-${{ github.sha }}
fail-on-cache-miss: true
- name: setup node
uses: actions/setup-node@v3

View File

@ -49,17 +49,12 @@ jobs:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Maven build
id: maven_build
run: |
./it.sh ci
- name: Cache Maven m2 repository
id: maven
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: maven-${{ runner.os }}-${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }}
key: maven-${{ runner.os }}-${{ matrix.jdk }}-${{ github.sha }}
restore-keys: |
maven-${{ runner.os }}-${{ matrix.jdk }}
@ -69,10 +64,26 @@ jobs:
with:
path: |
./**/target
key: maven-${{ runner.os }}-${{ matrix.jdk }}-targets-${{ hashFiles('**/pom.xml') }}
key: maven-${{ runner.os }}-${{ matrix.jdk }}-targets-${{ github.sha }}
restore-keys: |
maven-${{ runner.os }}-${{ matrix.jdk }}-targets
- name: Cache image
id: docker_container
uses: actions/cache@v3
with:
key: druid-container-jdk${{ matrix.jdk }}.tar.gz-${{ github.sha }}
path: |
./druid-container-jdk${{ matrix.jdk }}.tar.gz
./integration-tests-ex/image/target/env.sh
restore-keys: |
druid-container-jdk${{ matrix.jdk }}.tar.gz-
- name: Maven build
id: maven_build
run: |
./it.sh ci
- name: Container build
run: |
./it.sh image
@ -85,17 +96,6 @@ jobs:
echo $DRUID_IT_IMAGE_NAME
docker save "$DRUID_IT_IMAGE_NAME" | gzip > druid-container-jdk${{ matrix.jdk }}.tar.gz
- name: Cache image
id: docker_container
uses: actions/cache@v3
with:
key: druid-container-jdk${{ matrix.jdk }}.tar.gz-${{ hashFiles('**/pom.xml') }}
path: |
./druid-container-jdk${{ matrix.jdk }}.tar.gz
./integration-tests-ex/image/target/env.sh
restore-keys: |
druid-container-jdk${{ matrix.jdk }}.tar.gz-
unit-tests:
strategy:
fail-fast: false