feat(List): new component #50
Workflow file for this run
This file contains hidden or 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: Performance Testing | |
| on: | |
| pull_request: | |
| paths: | |
| - "packages/core/src/components/**" | |
| - "packages/components/**" | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| build: | |
| name: Build | |
| uses: ./.github/workflows/build-and-upload.yml | |
| with: | |
| skip_release_artifacts: true | |
| secrets: | |
| npm_token: ${{ secrets.npm_token }} | |
| performance: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| npm_token: ${{ secrets.npm_token }} | |
| - name: Download build artifacts | |
| uses: ./.github/actions/download-builds | |
| if: ${{ needs.build.outputs.has_changes == 'true' }} | |
| - name: Install Playwright | |
| # Use root playwright directly (not npx) due to version mismatch with @playwright/test | |
| run: ./node_modules/playwright/cli.js install --with-deps chromium | |
| - name: Test PR branch | |
| run: | | |
| mkdir -p scripts/performance/reports | |
| cd packages/docs | |
| yarn storybook & | |
| STORYBOOK_PID=$! | |
| trap 'kill $STORYBOOK_PID 2>/dev/null || true' EXIT | |
| npx wait-on http://localhost:7008 --timeout 120000 || exit 1 | |
| PERFORMANCE_TEST=true ./node_modules/.bin/test-storybook --url http://localhost:7008 --maxWorkers=4 || true | |
| continue-on-error: true | |
| - name: Save PR metrics | |
| run: | | |
| node scripts/performance/aggregate-metrics.js | |
| cp scripts/performance/reports/metrics.json scripts/performance/reports/pr.json 2>/dev/null || \ | |
| echo '{"timestamp":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","components":{}}' > scripts/performance/reports/pr.json | |
| - name: Test base branch | |
| run: | | |
| rm -f scripts/performance/reports/.metrics-temp.jsonl | |
| PR_SHA=$(git rev-parse HEAD) | |
| BASE=$(git merge-base origin/master HEAD) | |
| echo "Testing base commit: $BASE" | |
| git checkout $BASE | |
| yarn install --frozen-lockfile | |
| yarn build | |
| ./node_modules/playwright/cli.js install --with-deps chromium | |
| cd packages/docs | |
| yarn storybook & | |
| STORYBOOK_PID=$! | |
| trap 'kill $STORYBOOK_PID 2>/dev/null || true' EXIT | |
| npx wait-on http://localhost:7008 --timeout 120000 || exit 1 | |
| PERFORMANCE_TEST=true ./node_modules/.bin/test-storybook --url http://localhost:7008 --maxWorkers=4 || true | |
| cd ../.. | |
| node scripts/performance/aggregate-metrics.js | |
| cp scripts/performance/reports/metrics.json scripts/performance/reports/base.json 2>/dev/null || \ | |
| echo '{"timestamp":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","components":{}}' > scripts/performance/reports/base.json | |
| git checkout $PR_SHA | |
| continue-on-error: true | |
| - name: Generate report | |
| run: node scripts/performance/compare-metrics.js | |
| continue-on-error: true | |
| - name: Post PR comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| if: hashFiles('scripts/performance/reports/comparison.md') != '' | |
| with: | |
| header: performance | |
| path: scripts/performance/reports/comparison.md | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: performance-reports | |
| path: scripts/performance/reports/*.json | |
| retention-days: 7 |