-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
72 lines (63 loc) Β· 1.92 KB
/
benchmark-workflow.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
on:
schedule:
- cron: '0 2-23/4 * * *'
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: ''
name: 'Performance tests'
jobs:
benchmark:
strategy:
fail-fast: false
matrix:
benchmark:
- [Next.js, next]
- [Gatsby, gatsby]
packageManager:
- classic
- yarn
- yarn-nm
- yarn-pnpm
- npm
- pnpm
name: 'Benchmarking ${{matrix.benchmark[0]}} w/ ${{matrix.packageManager}}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
with:
minify-bundle: true
- 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: 'Install the package manager'
run: |
case ${{matrix.packageManager}} in
npm)
npm install -g npm@^7;;
pnpm)
npm install -g pnpm;;
classic)
npm install -g yarn;;
esac
- name: 'Creates a temporary directory'
run: |
BENCH_DIR=$(mktemp -d)
echo "BENCH_DIR=$BENCH_DIR" >> "$GITHUB_ENV"
- name: 'Run the performance test'
run: |
bash scripts/bench-run.sh '${{matrix.packageManager}}' '${{matrix.benchmark[1]}}' "$BENCH_DIR"
if [[ '${{github.event.inputs.sendReport}}' != 'false' ]]; then
yarn node scripts/submit-bench-data.js '${{matrix.packageManager}}' '${{matrix.benchmark[1]}}' "$BENCH_DIR"
fi
env:
DD_API_KEY: ${{secrets.DD_API_KEY}}
HYPERFINE_OPTIONS: ${{github.event.inputs.hyperfineOptions}}