Bug fix: use cast_slice_mut since not all array sizes are Pod #20
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
name: Rust | |
on: | |
push: | |
branches: [ "master" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install gnuplot | |
run: | | |
sudo apt-get update | |
sudo apt install gnuplot | |
- name: Restore Rust cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/debug/ | |
target/release/ | |
Cargo.lock | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml', 'src/**/*.rs', 'benches/**/*.rs', '.github/workflows/rust.yml') }} | |
- name: Install nightly Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- name: Unit Tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
toolchain: nightly | |
- name: Build Benchmarks | |
uses: actions-rs/cargo@v1 | |
with: | |
command: bench | |
args: --no-run | |
toolchain: nightly | |
- name: Save Rust cache | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/debug/ | |
target/release/ | |
Cargo.lock | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml', 'src/**/*.rs', 'benches/**/*.rs', '.github/workflows/rust.yml') }} | |
- name: Run benchmarks | |
uses: actions-rs/cargo@v1 | |
with: | |
command: bench | |
toolchain: nightly | |
- name: Upload benchmark reports | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Criterion report | |
path: target/criterion | |
if-no-files-found: error |