name: CI # Pull requests from outside contributors wait for a maintainer's approval # before they run (Settings > Actions > General: all outside contributors). on: pull_request: push: branches: [main] concurrency: group: ci-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: typecheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v7 with: node-version: 24 cache: pnpm - run: pnpm install --frozen-lockfile # The apps and the docs type-check against the built package. - run: pnpm -C packages/route-stack build - run: pnpm typecheck lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v7 with: node-version: 24 cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm lint # A job per browser: the WebKit tests need a page per file (below), and # the Chromium ones then run without the extra workers, whose load made # their mid-slide checks miss the slide. test: name: test (${{ matrix.name }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - name: chromium os: ubuntu-latest browser: chromium - name: webkit # macOS: Linux's WebKit build differs from Safari's (its Navigation # API among others), and the WebKit tests stand for iOS WebViews. os: macos-latest browser: webkit steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v7 with: node-version: 24 cache: pnpm - run: pnpm install --frozen-lockfile # With its system libraries on Linux; macOS needs none. - run: pnpm -C packages/route-stack exec playwright install --with-deps ${{ matrix.browser }} # One file at a time, so no test shares the machine with another. - if: matrix.name == 'chromium' working-directory: packages/route-stack run: pnpm exec vitest run --project unit --project "browser (chromium)" --project "browser-basepath*" --maxWorkers=1 --no-file-parallelism # A process per file: WebKit allows a page 100 history writes per 10 # seconds, and files sharing a page go past it. - if: matrix.name == 'webkit' working-directory: packages/route-stack run: | status=0 for file in $(find src -name '*.browser.test.*' ! -name '*.basepath.*' | sort); do pnpm exec vitest run --project "browser (webkit)" --no-passWithNoTests "$file" || status=1 done exit $status