docs: installation and FAQ #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: Tests CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the branches below | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
# Allows one to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Test for the following Typst versions | |
# 0.11.0 (earliest supported), | |
# 0.11.1, 0.12.0 (latest supported) | |
typst-version: [v0.11.0, v0.11.1, v0.12.0] | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: 📁 Prepare cargo cache | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: cargo | |
version: 1.0 | |
- name: 📥 Install typst-test from GitHub | |
uses: baptiste0928/[email protected] | |
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: ${{ matrix.typst-version }} | |
- name: 🛠️ Compile integration tests | |
run: | | |
ANSI_RED=$'\e[31m' | |
ANSI_GREEN=$'\e[32m' | |
ANSI_BLUE=$'\e[34m' | |
ANSI_END=$'\e[0m' | |
status=0 | |
for doc in test/integration/*.typ | |
do | |
echo "Compiling ${ANSI_BLUE}$doc${ANSI_END}..." | |
if typst compile "$doc" --root . --timings "$doc.t.json" | |
then | |
echo "Compiled ${ANSI_BLUE}$doc${ANSI_END} in ${ANSI_GREEN}$(jq '.[-1]?.ts / 1000' <$doc.t.json) ms${ANSI_END}" | |
else | |
echo "Failed to compile ${ANSI_RED}$doc${ANSI_END}" | |
status=1 | |
fi | |
done | |
exit $status | |
- name: ⚠️ Skip incompatible unit tests (Typst v0.11) | |
if: ${{ matrix.typst-version == 'v0.11.0' || matrix.typst-version == 'v0.11.1' }} | |
run: | | |
rm -rf test/unit/elements/show-body-order | |
rm -rf test/unit/elements/reference | |
rm -rf test/unit/elements/outline | |
- name: 🛠️ Run unit tests | |
run: typst-test run | |
- name: 📤 Archive test artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: artifacts-typst-${{ matrix.typst-version }} | |
path: | | |
test/unit/**/diff/*.png | |
test/unit/**/out/*.png | |
test/unit/**/ref/*.png | |
retention-days: 3 |