Manual #395
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
runs-on: ${{ 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 | |
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 |