|
| 1 | +name: Large tests |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - "test-large/**" |
| 6 | + schedule: |
| 7 | + - cron: "3 0 * * *" # Run every day at 03:00 UTC. |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +# Disable multiple concurrent runs on the same branch |
| 11 | +# When a new CI build is triggered, it will cancel the |
| 12 | +# other in-progress ones (for the same branch) |
| 13 | +concurrency: |
| 14 | + group: ${{ github.head_ref || github.run_id }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + # This is already built daily by the "build.yml" file |
| 19 | + # But we also want to include this in the checks that run on each push. |
| 20 | + build-container-image: |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + fetch-depth: 0 |
| 26 | + |
| 27 | + - name: Get current date |
| 28 | + id: date |
| 29 | + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
| 30 | + |
| 31 | + - name: Cache container image |
| 32 | + id: cache-container-image |
| 33 | + uses: actions/cache@v4 |
| 34 | + with: |
| 35 | + key: v4-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/*.py', 'dangerzone/container_helpers/*', 'install/common/build-image.py') }} |
| 36 | + path: |- |
| 37 | + share/container.tar.gz |
| 38 | + share/image-id.txt |
| 39 | +
|
| 40 | + - name: Build Dangerzone container image |
| 41 | + if: ${{ steps.cache-container-image.outputs.cache-hit != 'true' }} |
| 42 | + run: | |
| 43 | + python3 ./install/common/build-image.py |
| 44 | +
|
| 45 | + run-large-tests: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: |
| 48 | + - build-container-image |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] |
| 52 | + |
| 53 | + steps: |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v4 |
| 56 | + |
| 57 | + - name: Get current date |
| 58 | + id: date |
| 59 | + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
| 60 | + |
| 61 | + - name: Restore container image |
| 62 | + uses: actions/cache/restore@v4 |
| 63 | + with: |
| 64 | + key: v4-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/*.py', 'dangerzone/container_helpers/*', 'install/common/build-image.py') }} |
| 65 | + path: |- |
| 66 | + share/container.tar.gz |
| 67 | + share/image-id.txt |
| 68 | + fail-on-cache-miss: true |
| 69 | + |
| 70 | + - name: Install requirements |
| 71 | + run: |- |
| 72 | + sudo apt update -y |
| 73 | + sudo apt install -y \ |
| 74 | + podman git-lfs libxml2-utils \ |
| 75 | + libqt6gui6 libxcb-cursor0 qt6-qpa-plugins \ |
| 76 | + python3 python3-poetry make |
| 77 | + poetry install |
| 78 | +
|
| 79 | + - name: Run large tests |
| 80 | + run: |- |
| 81 | + export TEST_GROUP_COUNT=20 |
| 82 | + export TEST_GROUP=${{ matrix.group }} |
| 83 | + poetry run make test-large |
| 84 | +
|
| 85 | + - name: Upload results |
| 86 | + uses: actions/upload-artifact@v4 |
| 87 | + with: |
| 88 | + name: results_${{ matrix.group }} |
| 89 | + path: tests/test_docs_large/results/junit |
0 commit comments