Tests CI #109
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" | |
build-example: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ⚙️ Setup Typst | |
uses: typst-community/setup-typst@v3 | |
id: setup-typst | |
with: | |
typst-version: v0.12.0 | |
cache-dependency-path: examples/requirements.typ | |
- name: 🛠️ Compile test document | |
run: "typst compile examples/demo.typ --root ." | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: ⚙️ Setup Typst | |
uses: typst-community/setup-typst@v3 | |
id: setup-typst | |
with: | |
typst-version: v0.12.0 | |
cache-dependency-path: requirements.typ | |
- name: 🧪 Run test suite | |
run: "typst-test --ignore-system-fonts 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 |