-
Notifications
You must be signed in to change notification settings - Fork 3
134 lines (119 loc) · 4.01 KB
/
manual.yaml
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
name: Manual
on:
workflow_dispatch:
inputs:
product:
description: 'product name of which to bench'
type: choice
required: true
options:
- RSPACK
- RSBUILD
- RSPRESS
- RSLIB
- MODERNJS_FRAMEWORK
case:
description: 'case name of which to bench'
type: choice
required: true
options:
- rspack-binary-size
- rsbuild-react
- rsbuild-vue3
- rsbuild-lit
- rsbuild-svelte
- rsbuild-vanilla
- rsbuild-arco-pro
- rsbuild-react-app-10k
- rspress-minimal
- rspress-website
- rspress-website-mdxjs
- rslib-node-basic
- rslib-react-basic
- app-minimal
- app-initial
- app-initial-rspack
- app-tailwind
- app-ssr
- app-ssg
- app-bff-koa
- app-arco-pro
- app-arco-pro-swc
- app-arco-pro-esbuild
- app-arco-pro-rspack
commitId:
description: 'commitId of your repo'
onlyInstallSize:
description: "If only want install size, set to 'true'"
specifiedVersion:
description: 'specified the install pkg version, etc. 0.0.0-nightly-20240107170612'
updateData:
description: 'Update data? (yes/no)'
required: false
default: 'no'
jobs:
bench:
strategy:
matrix:
include:
- case: ${{ github.event.inputs.case }}
product: ${{ github.event.inputs.product }}
# Use `ubuntu-latest` for `rspack-binary-size`
# Use self-hosted runner for other bench cases
runs-on: ${{ matrix.case == 'rspack-binary-size' && 'ubuntu-latest' || fromJSON(vars.SELF_LINUX_LABELS || '"ubuntu-latest"') }}
steps:
- name: Print runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache-dependency-path: pnpm-lock.yaml
- name: Activate corepack
shell: bash
run: |
# corepack > 0.24.1 will use native fetch
# and native fetch not support HTTP_PROXY
# https://github.com/nodejs/undici/issues/1650
npm install -g [email protected]
corepack enable
- name: Install Pnpm
run: pnpm -v && pnpm store path
- name: Cache pnpm cache
uses: actions/cache@v3
if: ${{ startsWith(runner.name, 'GitHub Actions') }}
with:
path: |
~/.cache/pnpm
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm run install:scripts
- name: 🚀 Run specified benchmark
run: cd scripts && SPECIFIED_VERSION=${{ github.event.inputs.specifiedVersion }} ONLY_INSTALL_SIZE=${{ github.event.inputs.onlyInstallSize }} GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} COMMIT_ID=${{ github.event.inputs.commitId }} pnpm start ${{ matrix.product }} ${{ matrix.case }}
- name: Setup git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Install rsync
# Only needed for self-hosted runners
if: ${{ matrix.case != 'rspack-binary-size' }}
run: |
apt-get update && apt-get install -y rsync
- name: Update data
uses: JamesIves/[email protected]
if: github.event.inputs.updateData == 'yes'
with:
branch: gh-pages
folder: data
target-folder: data
git-config-name: gh-pages-bot
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
clean: false