Repository navigation
78 lines (69 loc) · 1.87 KB
/
Copy pathbenchmark.yml
File metadata and controls
78 lines (69 loc) · 1.87 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
name: Benchmark
on:
push:
branches: [main, master]
paths:
- 'src/**'
- 'tests/perf/**'
- 'package.json'
- 'tsconfig*.json'
- 'vite.config.ts'
pull_request:
branches: [main, master]
paths:
- 'src/**'
- 'tests/perf/**'
- 'package.json'
- 'tsconfig*.json'
- 'vite.config.ts'
workflow_dispatch:
inputs:
mode:
description: Benchmark duration
required: true
default: quick
type: choice
options:
- quick
- full
suite:
description: Benchmark suite
required: true
default: all
type: choice
options:
- node
- browser
- all
schedule:
- cron: '0 18 * * 1'
permissions:
contents: read
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
BENCHMARK_MODE: ${{ github.event_name == 'schedule' && 'full' || inputs.mode || 'quick' }}
BENCHMARK_SUITE: ${{ github.event_name == 'schedule' && 'all' || inputs.suite || 'node' }}
steps:
- uses: actions/checkout@v7
- name: Use Node.js 20
uses: actions/setup-node@v7
with:
node-version: 20
- name: Install dependencies
run: npm install --no-package-lock --no-audit --no-fund
- name: Install Chromium
if: env.BENCHMARK_SUITE == 'browser' || env.BENCHMARK_SUITE == 'all'
run: npx playwright install --with-deps chromium
- name: Run benchmark
run: npm run benchmark -- --mode "$BENCHMARK_MODE" --suite "$BENCHMARK_SUITE"
- name: Upload benchmark reports
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-${{ env.BENCHMARK_MODE }}-${{ env.BENCHMARK_SUITE }}-node20
path: performance/
if-no-files-found: warn
retention-days: 30