-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (80 loc) · 2.86 KB
/
benchmark.yml
File metadata and controls
96 lines (80 loc) · 2.86 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Benchmark
on:
push:
branches: main
pull_request:
types: [opened, reopened, edited, synchronize]
jobs:
benchmark_base:
name: Continuous Benchmarking with Bencher
if: github.event_name == 'push'
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Run benchmarks
run: cd packages/bridge && CI=true node --experimental-transform-types bench/engine.bench.ts > bench-results.json 2>/dev/null
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: bench-results
path: packages/bridge/bench-results.json
- uses: bencherdev/bencher@main
- name: Track base branch benchmarks with Bencher
run: |
bencher run \
--project the-bridge \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch main \
--testbed ubuntu-latest \
--threshold-measure latency \
--threshold-test t_test \
--threshold-max-sample-size 64 \
--threshold-upper-boundary 0.99 \
--thresholds-reset \
--err \
--adapter json \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
--file packages/bridge/bench-results.json
benchmark_pr:
name: Continuous Benchmarking PRs with Bencher
# Only run for PRs from the same repo (not forks)
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Run benchmarks
run: cd packages/bridge && CI=true node --experimental-transform-types bench/engine.bench.ts > bench-results.json 2>/dev/null
- uses: bencherdev/bencher@main
- name: Track PR benchmarks with Bencher
run: |
bencher run \
--project the-bridge \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch "$GITHUB_HEAD_REF" \
--start-point "$GITHUB_BASE_REF" \
--start-point-hash '${{ github.event.pull_request.base.sha }}' \
--start-point-clone-thresholds \
--start-point-reset \
--testbed ubuntu-latest \
--err \
--adapter json \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
--file packages/bridge/bench-results.json