forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (85 loc) · 2.78 KB
/
dispatch-next-dev-custom-bench.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
name: Custom next-dev Benchmark
on:
workflow_dispatch:
inputs:
filter:
description: "Filter"
default: "(bench_startup|bench_hydration|bench_simple_file_change|bench_restart)/Turbopack"
required: true
counts:
description: "Modules counts"
default: "100,1000"
required: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
NODE_OPTIONS: "--max-old-space-size=32768"
jobs:
bench:
runs-on: ubuntu-latest-8-core-oss
name: ${{ github.event.inputs.filter }} - ${{ github.event.inputs.counts }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: Swatinem/rust-cache@v2
with:
key: benchmark-next-dev
- name: Clear benchmarks
run: rm -rf target/criterion
- name: Run cargo bench
uses: actions-rs/cargo@v1
timeout-minutes: 120
env:
TURBOPACK_BENCH_BUNDLERS: all
TURBOPACK_BENCH_COUNTS: ${{ github.event.inputs.counts }}
with:
command: bench
args: -p next-dev -- "${{ github.event.inputs.filter }}"
- 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: custom
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
if: always()
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/${{ 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 }})