-
Notifications
You must be signed in to change notification settings - Fork 24
45 lines (40 loc) · 1.47 KB
/
Continuous-Testing.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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: canonical/oci-factory/.github/workflows/Vulnerability-Scan.yaml@main
with:
oci-image-name: "${{ matrix.source-image }}"
oci-image-path: "oci/${{ matrix.name }}"
date-last-scan: ${{ needs.prepare-test-matrix.outputs.last-scan }}
secrets: inherit