Skip to content

Commit 74b5399

Browse files
authored
refactor: restructure hydration benchmark tests and configurations (#7850)
2 parents 8f9bd93 + 293fd54 commit 74b5399

18 files changed

+891
-2156
lines changed

.github/actions/benchmark/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ runs:
55
- name: Install dependencies
66
uses: ./.github/actions/pnpm-setup
77

8-
# - name: Install playwright dependencies and browsers
9-
# run: pnpm exec playwright install --with-deps chromium
10-
# shell: bash
11-
# working-directory: packages/tools/benchmark-tests
8+
- name: Install playwright dependencies and browsers
9+
run: pnpm exec playwright install --with-deps chromium
10+
shell: bash
11+
working-directory: packages/tools/benchmark-tests
1212

1313
- name: Build required packages
1414
run: pnpm build:deps
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Benchmark-Baseline
2+
3+
on:
4+
workflow_dispatch:
5+
6+
concurrency:
7+
group: 'workflow-${{ github.workflow }}-${{ github.ref }}'
8+
cancel-in-progress: true
9+
10+
jobs:
11+
benchmark:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Create GitHub App Token
15+
uses: actions/create-github-app-token@v2
16+
id: app-token
17+
with:
18+
app-id: ${{ secrets.APP_ID }}
19+
private-key: ${{ secrets.PRIVATE_KEY }}
20+
21+
- name: Get GitHub App User ID
22+
id: get-user-id
23+
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
24+
env:
25+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
26+
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
token: ${{ steps.app-token.outputs.token }}
32+
33+
- name: Install and execute benchmark
34+
uses: ./.github/actions/benchmark
35+
36+
- name: Remove husky
37+
run: rm -rf .husky
38+
shell: bash
39+
40+
- name: Copy result as new baseline
41+
run: cp packages/tools/benchmark-tests/benchmark-result.json packages/tools/benchmark-tests/benchmark-baseline.json
42+
43+
- name: Commit and push updated baseline
44+
uses: stefanzweifel/git-auto-commit-action@v5
45+
with:
46+
commit_message: 'chore: update benchmark-baseline.json [ci skip]'
47+
file_pattern: 'packages/tools/benchmark-tests/benchmark-baseline.json'
48+
commit_user_name: '${{ steps.app-token.outputs.app-slug }}[bot]'
49+
commit_user_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'

.github/workflows/benchmark.monitoring.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- release/2
7-
workflow_dispatch:
87

98
concurrency:
109
group: 'workflow-${{ github.workflow }}-${{ github.ref }}'
@@ -54,15 +53,3 @@ jobs:
5453
github-token: ${{ secrets.GITHUB_TOKEN }}
5554
output-file-path: packages/tools/benchmark-tests/benchmark-result.json
5655
tool: customSmallerIsBetter
57-
58-
- name: Copy result as new baseline
59-
run: cp packages/tools/benchmark-tests/benchmark-result.json packages/tools/benchmark-tests/benchmark-baseline.json
60-
61-
- name: Commit and push updated baseline
62-
uses: stefanzweifel/git-auto-commit-action@v5
63-
with:
64-
commit_message: 'chore: update benchmark-baseline.json [ci skip]'
65-
file_pattern: 'packages/tools/benchmark-tests/benchmark-baseline.json'
66-
commit_user_name: '${{ steps.app-token.outputs.app-slug }}[bot]'
67-
commit_user_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
68-
push_options: '--force'

.github/workflows/benchmark.pr-check.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ jobs:
2121
- name: Install and execute benchmark
2222
uses: ./.github/actions/benchmark
2323

24-
- name: Load benchmark from target branch
25-
run: |
26-
git fetch origin ${{ github.base_ref }}
27-
git show origin/${{ github.base_ref }}:packages/tools/benchmark-tests/benchmark-baseline.json > packages/tools/benchmark-tests/benchmark-baseline.json || echo "[]" > packages/tools/benchmark-tests/benchmark-baseline.json
28-
2924
- name: Compare benchmark with baseline
3025
run: node scripts/compare-benchmark.mjs
3126
working-directory: packages/tools/benchmark-tests

packages/tools/benchmark-tests/.knip.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"$schema": "https://unpkg.com/knip@5/schema.json",
3-
"entry": ["tests/*.spec.ts"],
4-
"ignore": ["tests/benchmark.test.ts"],
3+
"entry": ["**/*.ts"],
4+
"ignore": ["public/{assets,components,theme}/**"],
55
"ignoreBinaries": ["build"],
66
"ignoreDependencies": [
77
"@public-ui/components",
88
"@public-ui/theme-default",
9+
"@types/mocha",
10+
"@wdio/globals",
911
"@wdio/local-runner",
1012
"@wdio/mocha-framework",
1113
"@wdio/spec-reporter",
12-
"adopted-style-sheets",
1314
"chromedriver",
1415
"serve"
1516
],

0 commit comments

Comments
 (0)