clap/.github/workflows/benchmark.yml

47 lines
1.5 KiB
YAML
Raw Normal View History

2020-03-14 14:05:10 +00:00
name: Benchmark
2020-03-05 01:20:05 +00:00
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
jobs:
Benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update rust
run: rustup toolchain update stable
- name: Run benchmarks
run: cargo bench -- -R bencher | tee output.txt
- name: Download base benchmark
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
${{ runner.os }}-benchmark-${{ github.ref }}
${{ runner.os }}-benchmark
2020-03-14 14:05:10 +00:00
- name: Compare benchmarks for Pull Requests
uses: rhysd/github-action-benchmark@v1
if: github.event_name == 'pull_request'
2020-03-05 01:20:05 +00:00
with:
tool: cargo
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ github.token }}
comment-always: true
2020-03-14 14:05:10 +00:00
save-data-file: false
- name: Compare benchmarks for master branch
uses: rhysd/github-action-benchmark@v1
if: github.event_name == 'push'
with:
tool: cargo
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ github.token }}
alert-threshold: 125%
comment-on-alert: true