-
Notifications
You must be signed in to change notification settings - Fork 7
98 lines (79 loc) · 2.4 KB
/
benchmarks.yml
File metadata and controls
98 lines (79 loc) · 2.4 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
97
98
name: 'Performance tests'
on:
schedule:
- cron: '0 2-23/4 * * *'
push:
branches: [main]
workflow_dispatch:
inputs:
sendReport:
description: 'Whether to send the stats to the Datadog dashboards'
required: true
default: 'false'
hyperfineOptions:
description: 'Options passed to Hyperfine'
required: false
default: ''
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: 'Building the benchmark binary'
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Build the repository
uses: ./.github/actions/build
with:
target: x86_64-unknown-linux-musl
profile: release-lto
- name: Store the build artifacts
uses: actions/upload-artifact@v4
with:
name: benchmark-binary
path: target/x86_64-unknown-linux-musl/release-lto
benchmark:
strategy:
matrix:
benchmark:
- [Next.js, next]
- [Gatsby, gatsby]
- [Monorepo, monorepo]
needs: [build]
name: 'Running the ${{matrix.benchmark[0]}} benchmark'
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Install Yarn Switch
uses: yarnpkg/setup-action@main
- uses: actions/download-artifact@v4
with:
name: benchmark-binary
path: local
- name: Set the +x flag on the binaries
run: |
chmod +x local/{yarn,yarn-bin}
- name: Install Flamegraph
run: |
cargo install flamegraph@0.6.9
- name: Install Hyperfine
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.10.0/hyperfine_1.10.0_amd64.deb
sudo dpkg -i hyperfine_1.10.0_amd64.deb
- name: 'Creates a temporary directory'
run: |
BENCH_DIR=$(mktemp -d)
echo "BENCH_DIR=$BENCH_DIR" >> "$GITHUB_ENV"
- name: Prepare Node
uses: ./.github/actions/prepare-node
- name: 'Run the performance test'
run: |
bash scripts/bench-run.sh zpm ${{matrix.benchmark[1]}} hyperfine "$BENCH_DIR" || true
if [[ '${{github.event.inputs.sendReport}}' != 'false' ]]; then
yarn node scripts/submit-bench-data.js zpm ${{matrix.benchmark[1]}} "$BENCH_DIR"
fi
env:
DD_API_KEY: ${{secrets.DD_API_KEY}}
HYPERFINE_OPTIONS: ${{github.event.inputs.hyperfineOptions}}