Tests CI #85
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: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
# Allows one to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
style: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 🍺 Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: 🍺 Install typos-cli | |
run: "brew install typos-cli" | |
- name: 🍺 Install typstyle | |
run: "brew install typstyle" | |
- name: 🧹 Check for typos | |
run: "typos" | |
- name: 🧹 Check style | |
run: "find . -name '*.typ' | xargs typstyle --check -c 120" | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Test for the following Typst versions | |
# 0.12.0 (minimum supported version) | |
typst-version: [v0.12.0, latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ⚙️ Setup Typst | |
uses: typst-community/setup-typst@v3 | |
id: setup-typst | |
with: | |
typst-version: ${{ matrix.typst-version }} | |
cache-dependency-path: examples/requirements.typ | |
- name: 🛠️ Compile test document | |
run: "typst compile examples/demo.typ --root ." | |
# The remaining actions are based from typst-test's book | |
# https://tingerrr.github.io/typst-test/guides/ci.html | |
- name: Probe runner package cache | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: cargo | |
version: 1.0 | |
- name: 🧪 Install typst-test | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: typst-test | |
git: https://github.com/tingerrr/typst-test.git | |
tag: ci-semi-stable | |
- name: Run test suite | |
run: typst-test run | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: artifacts | |
path: | | |
tests/**/diff/*.png | |
tests/**/out/*.png | |
tests/**/ref/*.png | |
retention-days: 5 |