ci: Add CI job for our large tests #3
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: Large tests | |
on: | |
push: | |
branches: | |
- "test-large/**" | |
schedule: | |
- cron: "3 0 * * *" # Run every day at 03:00 UTC. | |
workflow_dispatch: | |
# Disable multiple concurrent runs on the same branch | |
# When a new CI build is triggered, it will cancel the | |
# other in-progress ones (for the same branch) | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# This is already built daily by the "build.yml" file | |
# But we also want to include this in the checks that run on each push. | |
build-container-image: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Cache container image | |
id: cache-container-image | |
uses: actions/cache@v4 | |
with: | |
key: v4-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/*.py', 'dangerzone/container_helpers/*', 'install/common/build-image.py') }} | |
path: |- | |
share/container.tar.gz | |
share/image-id.txt | |
- name: Build Dangerzone container image | |
if: ${{ steps.cache-container-image.outputs.cache-hit != 'true' }} | |
run: | | |
python3 ./install/common/build-image.py | |
- name: Upload container image | |
uses: actions/upload-artifact@v4 | |
with: | |
name: container.tar | |
path: share/container.tar | |
run-large-tests: | |
runs-on: ubuntu-latest | |
needs: | |
- build-container-image | |
strategy: | |
matrix: | |
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Restore container image | |
uses: actions/cache/restore@v4 | |
with: | |
key: v4-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/*.py', 'dangerzone/container_helpers/*', 'install/common/build-image.py') }} | |
path: |- | |
share/container.tar.gz | |
share/image-id.txt | |
fail-on-cache-miss: true | |
- name: Install requirements | |
run: |- | |
apt-get update | |
apt-get install -y podman git-lfs libxml2-utils python3 python3-poetry make | |
poetry install --only=test | |
- name: Run large tests | |
run: |- | |
export TEST_GROUP_COUNT=20 | |
export TEST_GROUP=${{ matrix.group }} | |
poetry run make test-large | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: results_${{ matrix.group }} | |
path: tests/test_docs_large/results/junit |