-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
60 lines (50 loc) 路 1.54 KB
/
benchmark.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
name: Performance
on:
pull_request:
push:
branches: [main]
jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['18.x']
name: Test on node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{ matrix.node }}
- name: Install & build
run: |
node --version
npm --version
yarn --version
yarn install --frozen-lockfile
yarn build:benchmark
- name: Download previous benchmark data
uses: actions/cache@v3
with:
path: ./benchmark-cache
key: ${{ runner.os }}-benchmark
- name: Run benchmark
run: yarn benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: benchmarkjs
external-data-json-path: ./benchmark-cache/benchmark-data.json
output-file-path: output.txt
# comment for PRs that's updated with current perf relative to baseline (main)
summary-always: true
# warn if slowness is detected; might be transient on rerun
alert-threshold: 110%
comment-on-alert: true
fail-on-alert: true
# if things get considerably slower, deny the PR
fail-threshold: 120%
# needed for commenting on PRs
github-token: ${{ secrets.GITHUB_TOKEN }}