name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt -- --check
- name: Build
run: cargo check --all-targets --verbose
- name: Run tests
run: cargo test --all-targets --verbose
- name: Run doc tests
run: cargo test --doc --verbose
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
- name: Build benchmarks
run: cargo bench --bench ansi --no-run
- name: Build docs
run: cargo doc --no-deps
- name: Check package
run: cargo package --allow-dirty