name: Benchmarks
on:
pull_request:
branches:
- master
env:
RUSTFLAGS: -D warnings
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Set up gnuplot
run: sudo apt-get update && sudo apt-get install gnuplot
- name: Check out old code
uses: actions/checkout@v1
with:
ref: ${{ github.base_ref }}
- name: Compile benchmarks
run: cd benches && cargo bench --no-run
- name: Run benchmarks for old code
run: cd benches && cargo bench
- name: Check out new code
uses: actions/checkout@v1
with:
clean: false
ref: ${{ github.head_ref }}
- name: Compile benchmarks
run: cd benches && cargo bench --no-run
- name: Run benchmarks for new code
run: cd benches && cargo bench
- name: Upload benchmark comparison
uses: actions/upload-artifact@v1
with:
name: Benchmark report
path: benches/target/criterion
- name: Check code formatting
run: cd benches && cargo fmt -- --check
- name: Run static analysis on tests
run: cd benches && cargo clippy --all-targets