44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
test:
|
|
name: Test (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [windows-latest, macos-latest]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
|
|
- name: Install Rust toolchain
|
|
# dtolnay/rust-toolchain has no tagged releases; pinned to master @ 2026-06-20.
|
|
# When pinned to a SHA the channel must be given explicitly via `toolchain`.
|
|
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537
|
|
with:
|
|
toolchain: "1.96.0" # latest stable as of 2026-06-24
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache cargo build
|
|
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
|
|
- name: Format check
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --workspace --all-targets --locked -- -D warnings
|
|
|
|
- name: Run unit tests
|
|
run: cargo test --workspace --locked
|