typst/.github/workflows/ci.yml

71 lines
1.9 KiB
YAML
Raw Normal View History

name: Continuous integration
2023-12-28 16:16:37 +03:00
on: [push, pull_request, merge_group]
2022-11-22 22:17:51 +03:00
2023-04-19 18:51:33 +03:00
env:
RUSTFLAGS: "-Dwarnings"
2023-05-20 11:48:25 +03:00
RUSTDOCFLAGS: "-Dwarnings"
2024-05-08 14:01:08 +03:00
TYPST_TESTS_EXTENDED: true
2023-04-19 18:51:33 +03:00
2022-11-22 22:17:51 +03:00
jobs:
# This allows us to have one branch protection rule for the full test matrix.
# See: https://github.com/orgs/community/discussions/4324
2023-05-03 11:42:27 +03:00
tests:
name: Tests
runs-on: ubuntu-latest
needs: [test-matrix]
if: always()
steps:
- name: Tests successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Tests failing
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
test-matrix:
2023-05-03 11:42:27 +03:00
name: Tests
2024-03-04 19:46:57 +03:00
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
2022-11-22 22:17:51 +03:00
steps:
- uses: actions/checkout@v4
2024-03-22 16:30:47 +03:00
- uses: dtolnay/rust-toolchain@1.77.0
2022-11-22 22:17:51 +03:00
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --no-run
2023-03-29 20:49:27 +03:00
- run: cargo test --workspace --no-fail-fast
2023-05-03 11:42:27 +03:00
checks:
2023-05-20 11:48:25 +03:00
name: Check clippy, formatting, and documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-03-22 16:30:47 +03:00
- uses: dtolnay/rust-toolchain@1.77.0
with:
components: clippy, rustfmt
2023-05-03 11:42:27 +03:00
- uses: Swatinem/rust-cache@v2
2023-11-27 13:18:48 +03:00
- run: cargo clippy --workspace --all-targets --all-features
2023-05-20 11:48:25 +03:00
- run: cargo fmt --check --all
- run: cargo doc --workspace --no-deps
2023-05-03 11:42:27 +03:00
min-version:
name: Check mininum Rust version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-01-29 16:28:56 +03:00
- uses: dtolnay/rust-toolchain@1.74.0
2023-05-03 11:42:27 +03:00
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace
2023-12-05 21:26:58 +03:00
fuzz:
name: Check fuzzers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-09-13
- uses: Swatinem/rust-cache@v2
2024-05-02 18:19:11 +03:00
- run: cargo install --locked cargo-fuzz@0.12.0
2023-12-05 21:26:58 +03:00
- run: cd tests/fuzz && cargo fuzz build --dev