Skip to content

ci: add actionlint, zizmor, and oxfmt checks #27

ci: add actionlint, zizmor, and oxfmt checks

ci: add actionlint, zizmor, and oxfmt checks #27

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
env:
CARGO_TERM_COLOR: always
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: Format
command: cargo fmt --check
cache: false
- name: Clippy
command: cargo clippy -- -D warnings
cache: true
- name: Test
command: cargo test
cache: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: jdx/mise-action@7e36c90d9ab29c415a2384db3006f3ec8a8cc654 # v4.2.4
with:
install_args: rust
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
if: ${{ matrix.cache }}
- run: ${{ matrix.command }}
workflow-lint:
name: Workflow Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: jdx/mise-action@7e36c90d9ab29c415a2384db3006f3ec8a8cc654 # v4.2.4
with:
install_args: actionlint zizmor aqua:oxc-project/oxc/oxfmt
- name: actionlint
run: actionlint
- name: zizmor
run: zizmor .github/workflows/
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: oxfmt
run: oxfmt --check .
compile-test:
name: Compile Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: jdx/mise-action@7e36c90d9ab29c415a2384db3006f3ec8a8cc654 # v4.2.4
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: Build typdiff
run: cargo build
- name: Diff and compile (basic fixtures)
run: |
cargo run -- tests/fixtures/old.typ tests/fixtures/new.typ -o /tmp/diff-basic.typ
typst compile /tmp/diff-basic.typ /tmp/diff-basic.pdf
- name: Diff and compile (rich fixtures)
run: |
cargo run -- tests/fixtures/rich-old.typ tests/fixtures/rich-new.typ -o /tmp/diff-rich.typ
typst compile /tmp/diff-rich.typ /tmp/diff-rich.pdf