From 8854d83934b46926943374bfdb8e309472ae5359 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Tue, 23 Mar 2021 15:03:25 -0400 Subject: [PATCH] cache mac acceptance image Signed-off-by: Alex Goodman --- .github/workflows/validations.yaml | 16 +++++++++++++++- test/acceptance/mac.sh | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validations.yaml b/.github/workflows/validations.yaml index 83ed6f1c5..4f04003f4 100644 --- a/.github/workflows/validations.yaml +++ b/.github/workflows/validations.yaml @@ -99,6 +99,13 @@ jobs: - name: Run unit tests run: make unit + # TODO: remove me + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: unit-test-cache + path: syft/file/test-fixtures/cache + - uses: actions/upload-artifact@v2 with: name: unit-test-results @@ -207,7 +214,7 @@ jobs: - uses: actions/upload-artifact@v2 with: - name: branchmark-test-results + name: benchmark-test-results path: test/results/**/* - name: Update PR benchmark results comment @@ -302,6 +309,13 @@ jobs: name: artifacts path: snapshot + - name: Restore docker image cache + id: go-cache + uses: actions/cache@v2.1.3 + with: + path: /tmp/image.tar + key: ${{ runner.os }}-${{ hashFiles('test/acceptance/mac.sh') }} + - name: Run Acceptance Tests (Mac) run: make acceptance-mac diff --git a/test/acceptance/mac.sh b/test/acceptance/mac.sh index e6c955bc7..b55a488f7 100755 --- a/test/acceptance/mac.sh +++ b/test/acceptance/mac.sh @@ -33,7 +33,7 @@ trap cleanup EXIT skopeo --version || brew install skopeo # fetch test image -skopeo --override-os linux copy docker://docker.io/${TEST_IMAGE} docker-archive:${TEST_IMAGE_TAR} +[[ -f ${TEST_IMAGE_TAR} ]] || skopeo --override-os linux copy "docker://docker.io/${TEST_IMAGE}" "docker-archive:${TEST_IMAGE_TAR}" ls -alh ${TEST_IMAGE_TAR} # run syft