forked from vercel/turbo
-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (120 loc) · 4.31 KB
/
bench-turbopack-scheduled.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Benchmark other Bundlers
on:
schedule:
# Run every week on Sunday 12:42
- cron: "42 12 * * 0"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
NODE_OPTIONS: "--max-old-space-size=32768"
jobs:
bench:
strategy:
fail-fast: false
matrix:
bench:
# One of Turbopack CSR or SSR with 1000 modules is benchmarked in every run
# to create a baseline result for normalization (should the runners performance vary between jobs)
# This measures Next.js 13
- name: next 13
cache_key: next-dev
args: -p next-dev -- "(Turbopack SSR/1000|Next.js 13)"
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Next.js 12
- name: next 12
cache_key: next-dev
args: -p next-dev -- "(Turbopack SSR/1000|Next.js 12)"
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Next.js 11
- name: next 11
cache_key: next-dev
args: -p next-dev -- "(Turbopack SSR/1000|Next.js 11)"
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Vite
- name: vite
cache_key: next-dev
args: -p next-dev -- "(Turbopack CSR/1000|Vite)"
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Parcel
- name: parcel
cache_key: next-dev
args: -p next-dev -- "(Turbopack CSR/1000|Parcel)"
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
# This measures Webpack
- name: webpack
cache_key: next-dev
args: -p next-dev -- "(Turbopack CSR/1000|Webpack)"
TURBOPACK_BENCH_COUNTS: 100,500,1000
TURBOPACK_BENCH_BUNDLERS: all
runs-on: ubuntu-latest-8-core-oss
name: bench - ${{ matrix.bench.name }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: Swatinem/rust-cache@v2
with:
key: benchmark-${{ matrix.bench.cache_key }}
- name: Clear benchmarks
run: rm -rf target/criterion
- name: Run cargo bench
uses: actions-rs/cargo@v1
timeout-minutes: 180
env:
TURBOPACK_BENCH_BUNDLERS: ${{ matrix.bench.TURBOPACK_BENCH_BUNDLERS }}
TURBOPACK_BENCH_COUNTS: ${{ matrix.bench.TURBOPACK_BENCH_COUNTS }}
with:
command: bench
args: ${{ matrix.bench.args }}
- name: Install critcmp
if: always()
uses: actions-rs/cargo@v1
with:
command: install
args: critcmp
- name: Compare results
if: always()
run: critcmp --group "([^/]+/)[^/]+(?:/)(.+)" base
- name: Export results
if: always()
run: critcmp --export base > raw.json
- name: Upload results
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.bench.name }}
path: raw.json
# This avoids putting this data into the rust-cache
- name: Clear benchmarks
run: rm -rf target/criterion
commit_results:
name: Commit benchmark-data
needs: bench
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: |
echo "::set-output name=year::$(date +'%Y')"
echo "::set-output name=month::$(date +'%m')"
echo "::set-output name=date::$(date +'%s')"
echo "::set-output name=pretty::$(date +'%Y-%m-%d %H:%M')"
- name: Checkout benchmark-data
uses: actions/checkout@v3
with:
ref: benchmark-data
- name: Download benchmark data
uses: actions/download-artifact@v3
with:
path: data/${{ steps.date.outputs.year }}/${{ steps.date.outputs.month }}/ubuntu-latest-8-core/${{ steps.date.outputs.date }}-${{ github.sha }}
- name: Git pull
run: git pull --depth=1 --no-tags origin benchmark-data
- name: Push data to branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Benchmark result for ${{ steps.date.outputs.pretty }} (${{ github.sha }})