Add cpu features detection #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
strategy: | |
matrix: | |
settings: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-24.04-arm | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
fail-fast: false | |
runs-on: ${{ matrix.settings.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.settings.target }} | |
- name: print cpu features | |
run: | | |
rustup toolchain install nightly | |
cargo +nightly run --example cpu_features | |
- name: Run benchmarks | |
run: cargo test | |
bench: | |
strategy: | |
matrix: | |
settings: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-24.04-arm | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
fail-fast: false | |
runs-on: ${{ matrix.settings.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.settings.target }} | |
- name: Run benchmarks | |
run: cargo bench | |
env: | |
RUSTFLAGS: '-C target-cpu=native' |