2020-03-14 14:05:10 +00:00
|
|
|
name: Benchmark
|
2020-03-05 01:20:05 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
|
|
|
types: [opened, reopened, synchronize]
|
|
|
|
jobs:
|
|
|
|
Benchmark:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-04-10 10:31:46 +00:00
|
|
|
- name: Install rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- name: Checkout base
|
2020-03-05 01:20:05 +00:00
|
|
|
uses: actions/checkout@v2
|
2020-04-10 10:31:46 +00:00
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
- name: Cache cargo
|
2020-03-05 01:20:05 +00:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2020-04-13 00:36:08 +00:00
|
|
|
path: /home/runner/.cargo
|
2020-04-10 10:31:46 +00:00
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
- name: Bench base
|
|
|
|
run: cargo bench -- -R bencher | tee output.txt
|
|
|
|
- name: Save base benchmark
|
|
|
|
uses: pksunkara/github-action-benchmark@v1
|
2020-03-05 01:20:05 +00:00
|
|
|
with:
|
|
|
|
tool: cargo
|
|
|
|
output-file-path: output.txt
|
2020-04-10 10:31:46 +00:00
|
|
|
external-data-json-path: ./benchmark-data.json
|
|
|
|
read-commit-id: true
|
|
|
|
- name: Checkout pull request
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
clean: false
|
|
|
|
- name: Bench pull request
|
|
|
|
run: cargo bench -- -R bencher | tee output.txt
|
|
|
|
- name: Compare benchmarks
|
2020-04-13 00:36:08 +00:00
|
|
|
uses: pksunkara/github-action-benchmark@v2
|
2020-03-14 14:05:10 +00:00
|
|
|
with:
|
|
|
|
tool: cargo
|
|
|
|
output-file-path: output.txt
|
2020-04-10 10:31:46 +00:00
|
|
|
external-data-json-path: ./benchmark-data.json
|
2020-03-14 14:05:10 +00:00
|
|
|
github-token: ${{ github.token }}
|
2020-04-13 00:36:08 +00:00
|
|
|
annotate-always: true
|
|
|
|
- name: Install cargo-cache
|
|
|
|
uses: actions-rs/install@v0.1
|
|
|
|
with:
|
|
|
|
crate: cargo-cache
|
|
|
|
use-tool-cache: true
|
2020-04-10 10:31:46 +00:00
|
|
|
- name: Cleanup cache
|
2020-04-13 00:36:08 +00:00
|
|
|
run: cargo cache -a
|