name: CI
on:
push:
branches: [ main ]
pull_request:
types: [opened, reopened]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install nextest
shell: bash
run: |
curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- run: cargo fmt --all --check
- run: cargo check --all-features --workspace
- run: cargo clippy --all-features -- -D warnings
- run: RUSTFLAGS="-C target-cpu=native -C target-feature=+fma -C llvm-args=--fp-contract=fast" cargo test --all-features --doc -- --show-output
- run: RUSTFLAGS="-C target-cpu=native -C target-feature=+fma -C llvm-args=--fp-contract=fast" cargo nextest run --all-features
benchmarks:
name: Run benchmarks
runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Run benchmarks
run: RUSTFLAGS="-C target-cpu=native -C target-feature=+fma -C llvm-args=--fp-contract=fast" cargo +nightly bench --features cxx_bench
env:
RUSTFLAGS: --cfg=bench
- name: Run benchmarks with FMA
run: RUSTFLAGS="-C target-cpu=native -C target-feature=+fma -C llvm-args=--fp-contract=fast" cargo +nightly bench --features fma,cxx_bench
env:
RUSTFLAGS: --cfg=bench