diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 04295d84ae..b1911b21c8 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: ${{ hashFiles('ors-test-scenarios-war-bare.tar') != '' }} 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