-
-
Notifications
You must be signed in to change notification settings - Fork 869
52 lines (42 loc) · 1.63 KB
/
benchmark.yml
File metadata and controls
52 lines (42 loc) · 1.63 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
name: Performance Benchmark
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
benchmark:
name: Run Performance Benchmarks
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [0.8, 0.9, 0.10, 0.11, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
uses: ljharb/actions/node/install@main
with:
node-version: ${{ matrix.node-version }}
- name: Install benchmark dependencies
run: cd benchmark && npm install
# For PRs: Run benchmarks and compare against committed baseline
- name: Run benchmarks and compare against baseline
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "==== Running benchmarks and comparing against baseline ===="
# Run benchmarks using the compare script that uses the committed baseline
npm run benchmark:compare
# Print the Node.js version for debugging
echo "Benchmark completed on Node.js version: $(node --version)"
# For pushes to main: Run benchmarks against the committed baseline
- name: Run benchmarks on main branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
# Run benchmarks against the committed baseline
npm run benchmark:compare
# Print the Node.js version for debugging
echo "Benchmark completed on Node.js version: $(node --version)"