clap/.github/workflows/benchmark.yml
Pavan Kumar Sunkara 5c9cd1afdf Update CI
2021-05-25 23:42:55 +01:00

46 lines
1.3 KiB
YAML

name: Benchmark
on:
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
concurrency:
group: benchmark-${{ github.head_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