perf: add more performance rule #1951
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: CI Diff | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| # Ignore md files in PR to skip workflow when only documentation changes | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'website/**' | |
| push: | |
| branches: | |
| - main | |
| - v1.x | |
| # Ignore md files in push to skip workflow when only documentation changes | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'website/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| # Allow commenting on issues for `reusable-build.yml` | |
| issues: write | |
| # Allow commenting on pull requests | |
| pull-requests: write | |
| jobs: | |
| build: | |
| name: Build Bindings | |
| uses: ./.github/workflows/reusable-build.yml | |
| with: | |
| target: x86_64-unknown-linux-gnu | |
| runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }} | |
| test: false | |
| bench: false | |
| prefer_docker: false | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| diff-projects: | |
| name: Diff Benchmark Projects | |
| needs: build | |
| runs-on: ${{ fromJSON(vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"') }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| clean: ${{ runner.environment == 'github-hosted' }} | |
| - name: Download bindings | |
| uses: ./.github/actions/artifact/download | |
| with: | |
| name: bindings-x86_64-unknown-linux-gnu | |
| path: crates/node_binding/ | |
| - name: Setup Pnpm | |
| timeout-minutes: 5 | |
| uses: ./.github/actions/pnpm/setup | |
| with: | |
| node-version: 24 | |
| - name: Pnpm Install | |
| uses: ./.github/actions/pnpm/install-dependencies | |
| - name: Build JS | |
| run: pnpm run build:js | |
| - name: Clone build-tools-performance | |
| run: | | |
| cd .. | |
| git clone https://github.com/rstackjs/build-tools-performance.git | |
| - name: Link packages and install dependencies | |
| working-directory: ../build-tools-performance | |
| run: | | |
| npm pkg set "devDependencies.@rspack/binding=link:../rspack/crates/node_binding" | |
| npm pkg set "devDependencies.@rspack/core=link:../rspack/packages/rspack" | |
| npm pkg set "devDependencies.@rspack/cli=link:../rspack/packages/rspack-cli" | |
| # Use --no-frozen-lockfile to allow updating lockfile after modifying package.json | |
| pnpm install --no-frozen-lockfile | |
| - name: Build cases | |
| working-directory: ../build-tools-performance | |
| run: RSDOCTOR=true CI=true pnpm run build:cases | |
| - name: Report Compressed Size | |
| uses: web-infra-dev/rsdoctor-action@5b30d999c6e0a7840df1445d222b020ef282ed6f | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| file_path: '../build-tools-performance/**/dist/rsdoctor-data.json' | |
| target_branch: 'main' |