Skip to content

Commit

Permalink
Merge #11
Browse files Browse the repository at this point in the history
Add CI workflow and switch to new typst-test structure
  • Loading branch information
tingerrr authored Jan 22, 2024
1 parent fb7bba6 commit f7539fd
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Probe runner package cache
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: imagemagick cargo
version: 1.0

- name: Install nu from crates.io
uses: baptiste0928/[email protected]
with:
crate: nu

- name: Install just from crates.io
uses: baptiste0928/[email protected]
with:
crate: just

- 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: yusancky/setup-typst@v2
with:
version: 'v0.10.0'

- name: Test manual and example generation
run: just gen

- name: Run test suite
run: just test
12 changes: 6 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ default:

# generate example images
gen-examples:
typst compile \
@typst compile \
--root {{ self }} \
examples/main.typ \
examples/example{n}.png

ls examples \
@ls examples \
| where name =~ '\.png$' \
| get name \
| each {|it| magick convert $it -crop 1191x200++0+0 $it} \
| ignore

# generate docs
gen-docs:
ls docs/examples \
@ls docs/examples \
| where type == dir \
| get name \
| each {|it| \
Expand All @@ -40,7 +40,7 @@ gen-docs:
} \
| ignore

typst compile \
@typst compile \
--root {{ self }} \
docs/manual.typ \
docs/manual.pdf
Expand All @@ -55,6 +55,6 @@ watch-docs:
# generate examples and docs
gen: gen-examples gen-docs

# run a minimal test harness
# run the test suite
test filter='':
typst-test run {{ filter }}
@typst-test run {{ filter }}

0 comments on commit f7539fd

Please sign in to comment.