name: Tests on: pull_request: branches: - main - docusaurus-v** paths: - package.json - pnpm-lock.yaml - vitest.config.ts - test/** - packages/** - tsconfig.*.json - .github/workflows/tests.yml concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true permissions: contents: read jobs: test: name: Tests timeout-minutes: 30 runs-on: ubuntu-latest strategy: matrix: node: ['24.14', '26'] steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Install pnpm uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ matrix.node }} cache: pnpm - name: Installation run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile - name: Test run: pnpm test - name: Remove Theme Internal Re-export run: pnpm --filter @docusaurus/theme-common removeThemeInternalReexport - name: Docusaurus Build # We build 2 locales to ensure a localized site doesn't leak memory # See https://github.com/facebook/docusaurus/pull/10599 run: pnpm build:website:fast --locale en --locale fr env: # Our website should build even with limited memory # See https://github.com/facebook/docusaurus/pull/10590 NODE_OPTIONS: '--max-old-space-size=450' DOCUSAURUS_PERF_LOGGER: 'true' - name: Docusaurus site CSS order run: pnpm --filter website test:css-order - name: TypeCheck website # see https://github.com/facebook/docusaurus/pull/10486 run: pnpm --filter website typecheck - name: TypeCheck website - min version - v6.0 run: | pnpm add typescript@6.0 --save-exact -D -w --ignore-scripts pnpm --filter website typecheck - name: TypeCheck website - max version - Latest # For latest TS there are often lib check errors, so we disable it # Details: https://github.com/facebook/docusaurus/pull/10486 run: | pnpm add typescript@latest --save-exact -D -w --ignore-scripts pnpm --filter website typecheck --project tsconfig.skipLibCheck.json