name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.optional == true }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: macos-latest
optional: true
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
- name: Security audit
if: matrix.os == 'ubuntu-latest'
run: |
cargo install cargo-audit --locked
cargo audit
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Run tests
run: cargo test --all
- name: Run performance tests (release build)
if: matrix.os == 'ubuntu-latest'
run: cargo test --release -- --ignored --test performance_test