From c5ce989d111d0c716920bc11517445679e3f3dbb Mon Sep 17 00:00:00 2001 From: Julian Psotta Date: Tue, 12 Nov 2024 13:21:23 +0100 Subject: [PATCH] test(ors-test-scenarios): Test different caching --- .github/workflows/integration-tests.yml | 27 ++++++++++--------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 04295d84ae..a39ecffd15 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -25,18 +25,18 @@ jobs: java-version: '17' cache: 'maven' cache-dependency-path: ./pom.xml + - name: Docker image cache + id: cached-image + uses: actions/cache@v4 + with: + path: ors-test-scenarios-war-bare.tar + key: ${{ runner.os }}-ors-test-scenarios-war-bare - name: Cache Maven dependencies for the ors maven project run: | echo "Caching the maven dependencies" mvn -pl ors-test-scenarios package -Dmaven.test.skip=true -B dependency:go-offline -q - - name: Restore cached ors docker test image - id: restore-cached-image - uses: actions/cache/restore@v4 - with: - path: ors-test-scenarios-war-bare.tar - key: ${{ runner.os }}-ors-test-scenarios-war-bare - name: Load the docker image if cache hit - if: steps.restore-cached-image.outputs.cache-hit == 'true' + if: steps.cached-image.outputs.cache-hit == 'true' run: | echo "Loading the docker image" docker load -i ors-test-scenarios-war-bare.tar @@ -50,11 +50,6 @@ jobs: run: | echo "Exporting the docker image" docker save -o ors-test-scenarios-war-bare.tar ors-test-scenarios-war-bare:latest - - name: Save the docker image to the cache - uses: actions/cache/save@v4 - with: - path: ors-test-scenarios-war-bare.tar - key: ${{ runner.os }}-ors-test-scenarios-war-bare-${{ hashFiles('ors-test-scenarios-war-bare.tar') }} ors-test-scenarios: name: Integration test suite runs-on: ubuntu-latest @@ -79,14 +74,14 @@ jobs: id: buildx with: install: true - - name: Restore cached ors test image - id: restore-cached-image - uses: actions/cache/restore@v4 + - name: Docker image cache + id: cached-image + uses: actions/cache@v4 with: path: ors-test-scenarios-war-bare.tar key: ${{ runner.os }}-ors-test-scenarios-war-bare - name: Load the docker image - if: steps.restore-cached-image.outputs.cache-hit == 'true' + if: steps.cached-image.outputs.cache-hit == 'true' run: | echo "Loading the docker image" docker load -i ors-test-scenarios-war-bare.tar