| 1 | name: Check |
| 2 | |
| 3 | # Validates the repository type graph and website docs. |
| 4 | |
| 5 | on: |
| 6 | push: |
| 7 | branches: [main] |
| 8 | paths: |
| 9 | - "submodules/distilled" |
| 10 | - "benchmark/**" |
| 11 | - "examples/**" |
| 12 | - "packages/**" |
| 13 | - "website/**" |
| 14 | - "scripts/**" |
| 15 | - "patches/**" |
| 16 | - "package.json" |
| 17 | - "pnpm-lock.yaml" |
| 18 | - "pnpm-workspace.yaml" |
| 19 | - "turbo.json" |
| 20 | - "tsconfig.json" |
| 21 | - ".github/workflows/check.yml" |
| 22 | pull_request: |
| 23 | types: [opened, reopened, synchronize] |
| 24 | paths: |
| 25 | - "submodules/distilled" |
| 26 | - "benchmark/**" |
| 27 | - "examples/**" |
| 28 | - "packages/**" |
| 29 | - "website/**" |
| 30 | - "scripts/**" |
| 31 | - "patches/**" |
| 32 | - "package.json" |
| 33 | - "pnpm-lock.yaml" |
| 34 | - "pnpm-workspace.yaml" |
| 35 | - "turbo.json" |
| 36 | - "tsconfig.json" |
| 37 | - ".github/workflows/check.yml" |
| 38 | workflow_dispatch: |
| 39 | |
| 40 | permissions: |
| 41 | contents: read |
| 42 | |
| 43 | concurrency: |
| 44 | group: check-${{ github.ref }} |
| 45 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 46 | |
| 47 | jobs: |
| 48 | check: |
| 49 | name: Check |
| 50 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 51 | steps: |
| 52 | - name: Checkout repository |
| 53 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 54 | |
| 55 | - name: Checkout distilled |
| 56 | run: git submodule update --init --depth=1 --checkout -- submodules/distilled |
| 57 | |
| 58 | - name: Restore Astro build cache |
| 59 | uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| 60 | with: |
| 61 | path: website/node_modules/.astro |
| 62 | key: website-astro-check-${{ runner.os }}-${{ github.event.pull_request.number || 'main' }}-${{ github.sha }}-${{ github.workflow }}-${{ github.run_attempt }} |
| 63 | restore-keys: | |
| 64 | website-astro-check-${{ runner.os }}-${{ github.event.pull_request.number || 'main' }}-${{ github.sha }}- |
| 65 | website-astro-check-${{ runner.os }}-${{ github.event.pull_request.number || 'main' }}- |
| 66 | website-astro-check-${{ runner.os }}-main- |
| 67 | |
| 68 | - name: Restore Turbo cache |
| 69 | uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| 70 | with: |
| 71 | path: .turbo |
| 72 | key: turbo-${{ runner.os }}-${{ github.repository_id }}-${{ github.sha }}-${{ github.workflow }}-${{ github.run_attempt }} |
| 73 | restore-keys: | |
| 74 | turbo-${{ runner.os }}-${{ github.repository_id }}-${{ github.sha }}- |
| 75 | turbo-${{ runner.os }}-${{ github.repository_id }}- |
| 76 | |
| 77 | - name: Setup pnpm, Node.js, Bun and install dependencies |
| 78 | uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0 |
| 79 | with: |
| 80 | cache: true |
| 81 | install: true |
| 82 | require-lockfile: true |
| 83 | |
| 84 | - name: Run Node Utils tests |
| 85 | run: pnpm -C packages/node-utils test |
| 86 | |
| 87 | - name: Run pkg tests |
| 88 | run: pnpm -C packages/pkg test |
| 89 | |
| 90 | - name: Run Typecheck |
| 91 | run: pnpm tsc -b |
| 92 | |
| 93 | # Must run after `tsc -b`: it reads distilled's emitted `lib/*.d.ts`, |
| 94 | # and stale/missing declarations resolve to `any`. |
| 95 | - name: Lint providers |
| 96 | run: pnpm lint:providers |
| 97 | |
| 98 | - name: Test CLI launcher |
| 99 | run: timeout 240 pnpm test test/Cli/launcher.test.ts test/Cli/exitCodes.test.ts --retry 0 --concurrency 1 |
| 100 | |
| 101 | - name: Check API JSDocs |
| 102 | run: pnpm docs:check-jsdoc |
| 103 | |
| 104 | # An internal PR carrying `deploy-website` gets a full Astro build in |
| 105 | # website.yml via StaticSite. That build runs the same output validators, |
| 106 | # so avoid building the site a second time here. Forks still run this |
| 107 | # check because they cannot access the preview deployment secrets. |
| 108 | - name: Check website docs |
| 109 | if: >- |
| 110 | github.event.pull_request.head.repo.full_name != github.repository || |
| 111 | !contains(github.event.pull_request.labels.*.name, 'deploy-website') |
| 112 | run: pnpm docs:check |