add support for testing on prereleases #70
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
tests: | |
strategy: | |
# run tests on all versions, even if one fails | |
fail-fast: false | |
matrix: | |
# add any other Typst versions that your package should support | |
typst-version: | |
- typst: 0.12 | |
tytanic: 0.1 | |
# the docs don't need to build with all versions supported by the package; | |
# the latest one is enough | |
doc: true | |
- typst: 0.13.0-rc1 | |
tytanic: 0.2.0-rc1 | |
name: Test for ${{ matrix.typst-version.typst }} (Tytanic ${{ matrix.typst-version.tytanic }}${{ matrix.typst-version.doc && ', with docs' }}) | |
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 tytanic | |
uses: taiki-e/install-action@v2 | |
if: ${{ !contains(matrix.typst-version.tytanic, '-rc') }} | |
with: | |
tool: tytanic@${{ matrix.typst-version.tytanic }} | |
- name: Install tytanic (prerelease) | |
uses: taiki-e/cache-cargo-install-action@v2 | |
if: ${{ contains(matrix.typst-version.tytanic, '-rc') }} | |
with: | |
tool: tytanic@${{ matrix.typst-version.tytanic }} | |
- name: Setup typst | |
id: setup-typst | |
uses: typst-community/setup-typst@v3 | |
with: | |
typst-version: ${{ matrix.typst-version.typst }} | |
- name: Run test suite | |
run: just test | |
- name: Archive test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: typst-${{ steps.setup-typst.outputs.typst-version }}-test-results | |
path: | | |
tests/**/diff/*.png | |
tests/**/out/*.png | |
tests/**/ref/*.png | |
retention-days: 5 | |
- name: Build docs | |
if: ${{ matrix.typst-version.doc }} | |
run: just doc |