break: upgrade to React Router v8 #7941
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: Build Performance | |
| on: | |
| # Note! you can't safely use "pull_request_target" here | |
| # This workflow is mostly useful for "internal PRs" | |
| # External PRs won't be able to post a PR comment | |
| # See https://github.com/preactjs/compressed-size-action/issues/54 | |
| # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests | |
| pull_request: | |
| branches: | |
| - main | |
| - docusaurus-v** | |
| paths: | |
| - .github/workflows/build-perf.yml | |
| - package.json | |
| - pnpm-lock.yaml | |
| - packages/** | |
| - website/** | |
| - '!website/docs/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Posts a PR comment with build size differences from PR vs main branches | |
| build-size: | |
| permissions: | |
| checks: write # for preactjs/compressed-size-action to create and update the checks | |
| contents: read # for actions/checkout to fetch code | |
| issues: write # for preactjs/compressed-size-action to create comments | |
| pull-requests: write # for preactjs/compressed-size-action to write a PR review | |
| name: Build Size Report | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| DOCUSAURUS_INFRA: ['SLOWER', 'FASTER'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Set up Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| - name: Track build size changes | |
| uses: preactjs/compressed-size-action@f322c295dde06a1cb7ccaef105732dd8a726d1d9 # v2.10.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| build-script: build:website:fast | |
| clean-script: clear:website # see https://github.com/facebook/docusaurus/pull/6838 | |
| pattern: '{website/build/assets/js/main*js,website/build/assets/js/runtime~main*js,website/build/assets/css/styles*css,website/.docusaurus/globalData.json,website/.docusaurus/registry.js,website/.docusaurus/routes.js,website/.docusaurus/routesChunkNames.json,website/.docusaurus/site-metadata.json,website/.docusaurus/codeTranslations.json,website/.docusaurus/i18n.json,website/.docusaurus/docusaurus.config.mjs,website/build/index.html,website/build/docs.html,website/build/docs/**/*.html,website/build/blog.html,website/build/blog/**/*.html}' | |
| # HTML files: exclude versioned docs pages, tags pages, html redirect files | |
| exclude: '{website/build/docs/?.?.?/**/*.html,website/build/docs/next/**/*.html,website/build/blog/tags/**/*.html,**/*.html.html}' | |
| strip-hash: '\.([^;]\w{7})\.' | |
| minimum-change-threshold: 30 | |
| compression: none | |
| comment-key: DOCUSAURUS_INFRA_${{ matrix.DOCUSAURUS_INFRA }} | |
| env: | |
| DOCUSAURUS_SLOWER: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 'true' || 'false' }} | |
| DOCUSAURUS_PERF_LOGGER: 'true' | |
| # Ensures build times stay under reasonable thresholds | |
| build-time: | |
| name: Build Time Perf | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| DOCUSAURUS_INFRA: ['SLOWER', 'FASTER'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Set up Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| - name: Installation | |
| run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile | |
| # Ensure build with a cold cache does not increase too much | |
| - name: Build (cold cache) | |
| run: pnpm build:website:fast | |
| timeout-minutes: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 3 || 2 }} | |
| env: | |
| DOCUSAURUS_SLOWER: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 'true' || 'false' }} | |
| DOCUSAURUS_PERF_LOGGER: 'true' | |
| # Ensure build with a warm cache does not increase too much | |
| - name: Build (warm cache) | |
| run: pnpm build:website:fast | |
| # Temporary: upper value for Rspack until incremental cache works better | |
| timeout-minutes: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 1 || 2 }} | |
| env: | |
| DOCUSAURUS_SLOWER: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 'true' || 'false' }} | |
| DOCUSAURUS_PERF_LOGGER: 'true' | |
| # TODO post a GitHub comment with build with perf warnings? |