clap/.github/workflows/benchmark.yml
Ed Page 29a6a854f1 fix(ci): Don't have PRs canceling each others jobs
Using `head_ref`, we are making it so PRs are all in the same group.
When a new PR comes in (not just an update), it then cancels all other
PRs.  Switching to `ref` makes it so each PR is in its own concurrency
group.
2021-10-06 19:16:55 -05:00

46 lines
1.3 KiB
YAML

name: Benchmark
on:
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
concurrency:
group: benchmark-${{ github.ref }}
cancel-in-progress: true
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Checkout base
uses: actions/checkout@v2
with:
ref: master
- name: Bench base
run: cargo bench -- --output-format bencher | tee output.txt
- name: Save base benchmark
uses: pksunkara/github-action-benchmark@v1
with:
tool: cargo
output-file-path: output.txt
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 -- --output-format bencher | tee output.txt
- name: Compare benchmarks
uses: pksunkara/github-action-benchmark@v2
with:
tool: cargo
output-file-path: output.txt
external-data-json-path: ./benchmark-data.json
github-token: ${{ github.token }}
annotate-always: true