-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (50 loc) · 1.75 KB
/
bench.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
on:
push:
branches: [main]
pull_request:
name: Benchmark
jobs:
benchmark:
name: Run benchmarks
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust:
- stable
steps:
# Some of the snapshots have long file paths, so we need to enable long file paths on Windows where the limit is 260 by default
- name: Allow Long File Paths
if: matrix.os == 'windows-latest'
run: |
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
# https://github.com/actions/checkout/issues/1285#issuecomment-2042579471
git config --system core.longpaths true
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Download benchmark artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: bench.yml
name: benchmarks-${{ matrix.os }}
path: target/criterion
continue-on-error: true
- name: Run cargo benchmark
uses: actions-rs/cargo@v1
with:
command: bench
args: --bench parser --bench simplification -- --warm-up-time=2 --measurement-time=3 --sample-size=500 --color=always
- name: Archive benchmark results
if: ${{ github.ref == 'refs/heads/main'}}
uses: actions/upload-artifact@v3
with:
name: benchmarks-${{ matrix.os }}
path: target/criterion