Continuous image testing #498
This file contains hidden or 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: Continuous image testing | |
| on: | |
| schedule: | |
| - cron: "0 1 * * *" | |
| jobs: | |
| prepare-test-matrix: | |
| runs-on: ubuntu-latest | |
| name: Prepare released image revisions to be tested | |
| outputs: | |
| released-revisions-matrix: ${{ steps.prepare-test-matrix.outputs.released-revisions-matrix }} | |
| last-scan: ${{ steps.last-scan.outputs.date }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - run: pip install -r src/tests/requirements.txt | |
| - name: Prepare test matrix | |
| id: prepare-test-matrix | |
| run: ./src/tests/get_released_revisions.py --oci-images-path $PWD/oci | |
| - name: Infer date of last scan | |
| id: last-scan | |
| run: | | |
| # This is scheduled to run every day, so let's look at the previous | |
| # 26 hours, roughly | |
| set -ex | |
| last_scan="$(date --date='26 hours ago' +'%Y-%m-%dT%H:%M:00Z')" | |
| echo "date=$last_scan" >> "$GITHUB_OUTPUT" | |
| run-tests: | |
| name: Run tests for released images | |
| needs: [prepare-test-matrix] | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.prepare-test-matrix.outputs.released-revisions-matrix) }} | |
| uses: ./.github/workflows/Vulnerability-Scan.yaml | |
| with: | |
| oci-image-name: "${{ matrix.source-image }}" | |
| oci-image-path: "oci/${{ matrix.name }}" | |
| date-last-scan: ${{ needs.prepare-test-matrix.outputs.last-scan }} | |
| create-issue: true | |
| secrets: inherit |