forked from apestel/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (78 loc) · 2.55 KB
/
benches.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Benchmark Suite
on:
pull_request: {}
push:
branches:
- master
workflow_dispatch:
env:
VERBOSE: true
AWS_ACCESS_KEY_ID: "dummy"
AWS_SECRET_ACCESS_KEY: "dummy"
CI: true
jobs:
cancel-previous:
runs-on: ubuntu-latest
timeout-minutes: 3
if: github.ref != 'refs/heads/master'
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
bench:
name: Bench - Linux
runs-on: [self-hosted, linux, x64]
# Allow benchmarks show regressions until we can refine the thresholds for
# regression to reduce false positives.
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Download baseline benchmarks
uses: dawidd6/action-download-artifact@f2f4c0c7333a76ab3aff16e7b2cf4ed7f5a74556
continue-on-error: true
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: benches.yml
branch: master
name: criterion
path: target
- name: Check if there were master artifacts
run: |
test -f target/criterion.zip || echo "::warning::No master benchmark artifacts could be fetched for comparison."
- run: unzip target/criterion.zip
continue-on-error: true
- run: sudo bash scripts/environment/bootstrap-ubuntu-20.04.sh
- run: bash scripts/environment/prepare.sh
- run: echo "::add-matcher::.github/matchers/rust.json"
- run: make slim-builds
- name: Run benchmarks
run: |
mkdir -p target/criterion
make bench | tee target/criterion/out
- run: zip --recurse-paths target/criterion.zip target/criterion
- uses: actions/upload-artifact@v2
with:
name: "criterion"
path: "./target/criterion.zip"
- run: cat target/criterion/out | scripts/check-criterion-output.sh
master-failure:
name: master-failure
if: failure() && github.ref == 'refs/heads/master'
needs:
- cancel-previous
- bench
runs-on: ubuntu-latest
steps:
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/[email protected]
with:
args: "Master benchmarks failed: <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}>"