ci: enable docs preview domain #620
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: Test | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint-markdown: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint Markdown | |
| run: npm run lint:md | |
| # The docs site is deployed from main by deploy-docs.yml, so without this the | |
| # first place its build ever runs is the deploy. Fail it on the pull request | |
| # instead. | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| # Same full history the deploy uses. Each page's "Updated" date comes from | |
| # `git log -1 --format=%at <file>`, and in a shallow clone that resolves to | |
| # the one commit that was fetched -- so every page would claim to have been | |
| # updated at the same moment, and this job would be checking a build that is | |
| # not the one main deploys. | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| # packages/docs is excluded from the workspaces and the React example's | |
| # client is its own install, so both have lockfiles the root one does not | |
| # cover. | |
| cache-dependency-path: | | |
| package-lock.json | |
| packages/docs/package-lock.json | |
| examples/worker-react/client/package-lock.json | |
| # The docs build bundles each example's real source, so the React example's | |
| # client needs its own node_modules for esbuild to resolve react out of. | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| npm ci --prefix packages/docs | |
| npm ci --prefix examples/worker-react/client | |
| - name: Build docs | |
| run: npm run build:docs | |
| - name: Check docs | |
| run: npm --prefix packages/docs run check | |
| test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/playwright:v1.56.1-noble | |
| options: --user 1001 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Setup Bun | |
| run: npm install -g bun | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Run tests | |
| run: npm run test:ci | |
| - name: Run type tests | |
| run: npm run test:types |