Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/benchmark/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Benchmark Execution
runs:
using: 'composite'
steps:
- name: Install dependencies
uses: ./.github/actions/pnpm-setup

- name: Install playwright dependencies and browsers
run: pnpm exec playwright install --with-deps chromium
shell: bash
working-directory: packages/tools/benchmark-tests

- name: Build required packages
run: pnpm build:deps
shell: bash
working-directory: packages/tools/benchmark-tests

- name: Run benchmark tests
run: pnpm test-benchmark
shell: bash
working-directory: packages/tools/benchmark-tests
64 changes: 64 additions & 0 deletions .github/workflows/benchmark.monitoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Benchmark-Monitoring

on:
push:
branches:
- develop
workflow_dispatch:

concurrency:
group: 'workflow-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- name: Install and execute benchmark
uses: ./.github/actions/benchmark

- name: Remove husky
run: rm -rf .husky
shell: bash

- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
alert-threshold: 10%
auto-push: true
fail-threshold: 25%
gh-pages-branch: benchmarks
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file-path: packages/tools/benchmark-tests/benchmark-result.json
tool: customSmallerIsBetter

- name: Copy result as new baseline
run: cp packages/tools/benchmark-tests/benchmark-result.json packages/tools/benchmark-tests/benchmark-baseline.json

- name: Commit and push updated baseline
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: update benchmark-baseline.json [ci skip]'
file_pattern: 'packages/tools/benchmark-tests/benchmark-baseline.json'
commit_user_name: '${{ steps.app-token.outputs.app-slug }}[bot]'
commit_user_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
push_options: '--force'
46 changes: 46 additions & 0 deletions .github/workflows/benchmark.pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Benchmark-PR-Check

on:
pull_request:

concurrency:
group: 'workflow-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true

- name: Install and execute benchmark
uses: ./.github/actions/benchmark

- name: Load benchmark from target branch
run: |
git fetch origin ${{ github.base_ref }}
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

- name: Compare benchmark with baseline
run: node scripts/compare-benchmark.mjs
working-directory: packages/tools/benchmark-tests

- name: Find comment
uses: peter-evans/find-comment@v3
id: fc
with:
body-includes: Hydration Benchmark Report
comment-author: 'github-actions[bot]'
issue-number: ${{ github.event.pull_request.number }}

- name: Post PR Comment
uses: peter-evans/create-or-update-comment@v4
with:
body-path: packages/tools/benchmark-tests/benchmark-report.md
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
issue-number: ${{ github.event.pull_request.number }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
package: ['@public-ui/test-tag-name-transformer', '@public-ui/theme-default', '@public-ui/theme-bwst']
package: ['test-tag-name-transformer', 'theme-default', 'theme-bwst']
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"dependencies": {
"@floating-ui/dom": "1.7.0",
"adopted-style-sheets": "1.1.8",
"adopted-style-sheets": "1.1.9-rc.18",
"clsx": "2.1.1",
"color-convert": "2.0.1",
"color-rgba": "2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@types/prettier": "2.7.3",
"@unocss/preset-mini": "0.58.9",
"@unocss/webpack": "0.58.9",
"adopted-style-sheets": "1.1.8",
"adopted-style-sheets": "1.1.9-rc.18",
"ajv": "8.17.1",
"cpy-cli": "5.0.0",
"cross-env": "7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/samples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/react-dom": "18.3.7",
"@unocss/preset-uno": "0.58.9",
"@unocss/webpack": "0.58.9",
"adopted-style-sheets": "1.1.8",
"adopted-style-sheets": "1.1.9-rc.18",
"ajv": "8.17.1",
"cpy-cli": "5.0.0",
"eslint-plugin-jsx-a11y": "6.10.2",
Expand Down
6 changes: 6 additions & 0 deletions packages/tools/benchmark-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/public/assets/
/public/components/
/public/theme/
/test-results/
benchmark-report.md
benchmark-result.json
7 changes: 7 additions & 0 deletions packages/tools/benchmark-tests/.knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["tests/*.spec.ts"],
"ignoreBinaries": ["build"],
"ignoreDependencies": ["@public-ui/components", "@public-ui/theme-default", "adopted-style-sheets", "serve"],
"project": ["tests/**/*.ts"]
}
Loading
Loading