name: Continuous Integration
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
check-and-test:
name: Test on ${{ matrix.os }} (Rust ${{ matrix.rust }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo registry & build target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Verify Code Formatting
run: cargo fmt --check
- name: Run Clippy Linter
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build Crate
run: cargo build --verbose
- name: Run Test Suite
run: cargo test --all --verbose
- name: Run Demo Subcommands Verification
run: |
cargo run -- compare
cargo run -- trace --demo
cargo run -- bench --turns 10 --quiet
cargo run -- bench --turns 5 --json