-
Notifications
You must be signed in to change notification settings - Fork 324
chore(ci): add typecheck scripts for local TypeScript verification #1438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
457af43
d95c7e5
8feb437
857d922
8993c98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Typecheck | ||
|
|
||
| # Runs `yarn typecheck` from the repository root, which invokes | ||
| # `tsc --noEmit` in every TypeScript workspace. Complements the existing | ||
| # Lint and Test workflows (which do not run tsc) and catches type errors in | ||
| # seconds instead of waiting for the slow Docker-image build in pr-gate.yml. | ||
| # | ||
| # The web workspace is excluded here because `tsc --noEmit` in `packages/web` | ||
| # depends on `.next/types/**/*.ts` (declared in its tsconfig.json `include`) | ||
| # being generated by `next build`. Web is already type-checked transitively | ||
| # via the Docker build in pr-gate.yml. See issue #1437. | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["main"] | ||
|
|
||
|
|
||
| jobs: | ||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: "true" | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| cache: 'yarn' | ||
| cache-dependency-path: '**/yarn.lock' | ||
|
|
||
| - name: Install | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| # Build the type-source-of-truth workspaces first (schemas, db, shared, | ||
| # query-language) so their generated .d.ts files are fresh. Without | ||
| # this step, downstream workspaces see stale types and `tsc --noEmit` | ||
| # surfaces drift as errors. | ||
| - name: Build dependencies | ||
| run: yarn build:deps | ||
|
|
||
| # The db workspace's generated Prisma client must exist before its | ||
| # typecheck runs. Without this step, db's typecheck reports errors | ||
| # because the source-of-truth schema is newer than the generated client. | ||
| - name: Generate Prisma client | ||
| run: yarn workspace @sourcebot/db prisma:generate | ||
|
|
||
| # Excludes @sourcebot/web (see comment above). Runs tsc --noEmit in | ||
| # each remaining workspace in topological order. | ||
| - name: Typecheck | ||
| run: yarn workspaces foreach --all --topological --exclude @sourcebot/web run typecheck |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| "build": "cross-env SKIP_ENV_VALIDATION=1 yarn workspaces foreach --all --topological run build", | ||
| "test": "yarn workspaces foreach --all --topological run test", | ||
| "lint": "yarn workspaces foreach --all --topological run lint", | ||
| "typecheck": "yarn workspaces foreach --all --topological run typecheck", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Root typecheck includes webMedium Severity The new root Reviewed by Cursor Bugbot for commit 8feb437. Configure here. |
||
| "dev": "concurrently --kill-others --names \"zoekt,worker,web,schemas\" 'yarn dev:zoekt' 'yarn dev:backend' 'yarn dev:web' 'yarn watch:schemas'", | ||
| "with-env": "cross-env PATH=\"$PWD/bin:$PATH\" dotenv -e .env.development -c --", | ||
| "dev:zoekt": "yarn with-env zoekt-webserver -index .sourcebot/index -rpc", | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.