add test-cache-action.yaml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
env: | |
GO_VERSION: '1.22' | |
jobs: | |
integration: | |
name: Integration Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4.1.6 | |
- name: Restore test images from cache | |
uses: actions/cache@v4 | |
id: restore-test-images | |
with: | |
path: integration/testdata/fixtures/images | |
key: "2024-09-10" # trivy-test-images last update date | |
- name: Download test images if cache is missing | |
if: steps.restore-test-images.outputs.cache-hit != 'true' | |
run: mage test:fixtureContainerImages | |
- name: Save test images into cache if cache is missing | |
if: steps.restore-test-images.outputs.cache-hit != 'true' | |
uses: actions/cache@v4 | |
with: | |
path: integration/testdata/fixtures/images | |
key: "2024-09-10" # trivy-test-images last update date | |