From 59eaa34090cf1baf654255248c8fb82f9f7a61a1 Mon Sep 17 00:00:00 2001 From: tinger Date: Tue, 18 Feb 2025 19:10:22 +0100 Subject: [PATCH] github: Run matrix tests in worfkow Ensure we test assets on `v0.12.x` and the test suite on `v0.12.0` to `v0.13.0-rc1`. --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++++++-------- tests/features/footer/test.typ | 2 - 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea547ac..7f279c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Tests +name: Run tests and check assets on: push: branches: [ main ] @@ -7,37 +7,77 @@ on: jobs: tests: + name: Tests runs-on: ubuntu-latest + needs: [test-matrix] + if: always() steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Tests successful + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 - - name: Install just from crates.io - uses: baptiste0928/cargo-install@v2.2.0 - with: - crate: just + - name: Tests failing + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 + + test-matrix: + name: Tests ${{ matrix.typst-version.typst }} + runs-on: ubuntu-latest + strategy: + matrix: + typst-version: + - typst: 0.12 + tytanic: 0.1 - - name: Install tytanic from crates.io - uses: baptiste0928/cargo-install@v2.2.0 + - typst: 0.13.0-rc1 + tytanic: 0.2.0-rc1 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tytanic (binary) + if: ${{ !contains(matrix.typst-version.tytanic, '-rc') }} + uses: taiki-e/install-action@v2 with: - crate: tytanic - version: 0.2.0-rc1 + tool: tytanic@${{ matrix.typst-version.tytanic }} - - name: Setup typst - uses: typst-community/setup-typst@v2 + - name: Install tytanic (source) + uses: taiki-e/cache-cargo-install-action@v2 + if: ${{ contains(matrix.typst-version.tytanic, '-rc') }} with: - version: 'v0.12.0' + tool: tytanic@${{ matrix.typst-version.tytanic }} - - name: Run test suite and check assets - run: just ci + - name: Run test suite + id: run-suite + run: tt run --no-fail-fast --max-delta 1 - name: Archive artifacts uses: actions/upload-artifact@v4 if: always() with: - name: artifacts + name: test-artifacts-${{ matrix.typst-version.tytanic }} path: | tests/**/diff/*.png tests/**/out/*.png tests/**/ref/*.png retention-days: 5 + + assets: + name: Check assets and documentation + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install just + uses: taiki-e/install-action@v2 + with: + tool: just + + - name: Install typst + uses: typst-community/setup-typst@v3 + with: + typst-version: 0.12 + + - name: Check assets + run: just generate diff --git a/tests/features/footer/test.typ b/tests/features/footer/test.typ index 4a18663..ea01254 100644 --- a/tests/features/footer/test.typ +++ b/tests/features/footer/test.typ @@ -1,5 +1,3 @@ -/// [max-delta: 1] -/// /// Skipped because of minor floating point differences causing a mismatch. /// /// Synopsis: -- 2.51.2