Use the README as documentation for the crate root. #570
This file contains 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
on: [push, pull_request] | |
name: Benchmarks | |
jobs: | |
benchmark: | |
strategy: | |
matrix: | |
cpu: | |
- default | |
- native | |
include: | |
- cpu: default | |
flags: "" | |
- cpu: native | |
flags: "-C target-cpu=native" | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings ${{ matrix.flags }}" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: Create Cargo.lock file | |
run: cargo generate-lockfile | |
- name: Cache Cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/registry | |
key: cargo-registry-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
cargo-registry-${{ hashFiles('Cargo.toml') }} | |
cargo-registry | |
- name: Check Cargo version | |
run: cargo -V | tee cargo.version.txt | |
- name: Check CPU info | |
run: cat /proc/cpuinfo | |
- name: Check CPU flags | |
if: ${{ matrix.cpu == 'native' }} | |
run: cat /proc/cpuinfo | grep flags | tee cpuinfo.txt | |
- name: Write fake CPU flags file | |
if: ${{ matrix.cpu != 'native' }} | |
run: echo "Default CPU" > cpuinfo.txt | |
- name: Cache Cargo target | |
uses: actions/cache@v4 | |
with: | |
path: target | |
key: cargo-target-bench-${{ matrix.cpu }}-${{ hashFiles('cpuinfo.txt') }}-${{ hashFiles('cargo.version.txt') }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
cargo-target-bench-${{ matrix.cpu }}-${{ hashFiles('cpuinfo.txt') }}-${{ hashFiles('cargo.version.txt') }}-${{ hashFiles('Cargo.toml') }} | |
cargo-target-bench-${{ matrix.cpu }}-${{ hashFiles('cpuinfo.txt') }}-${{ hashFiles('cargo.version.txt') }} | |
- name: Run benchmarks | |
run: cargo bench --verbose --all-targets --no-run |