-
Notifications
You must be signed in to change notification settings - Fork 25
42 lines (40 loc) · 1.27 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
name: Benchmark
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Run benchmark
run: |
pnpm install
pnpm run bench --outputJson benchmark.json
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customSmallerIsBetter'
output-file-path: benchmark.json
external-data-json-path: ./cache/benchmark-main.json
fail-on-alert: true
- shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: branch
- name: Store benchmark data
if: steps.branch.outputs.branch == 'main'
run: cp benchmark.json ./cache/benchmark-main.json
# Push gh-pages branch by yourself
# - name: Push benchmark result
# run: git push 'https://you:${{ secrets.GITHUB_TOKEN }}@github.com/you/repo-name.git' gh-pages:gh-pages