diff --git a/.github/workflows/conventions.yml b/.github/workflows/conventions.yml index 03f9e1ee9..25a68f7c9 100644 --- a/.github/workflows/conventions.yml +++ b/.github/workflows/conventions.yml @@ -13,15 +13,6 @@ permissions: contents: read jobs: - typescript-sdk: - uses: thekevinscott/testing-conventions/.github/workflows/testing-conventions.yml@v0 - with: - languages: '["typescript"]' - source: packages/ts/src - config: testing-conventions.toml - base: ${{ github.event.pull_request.base.sha || 'origin/main' }} - rust_toolchain: true - rust: uses: thekevinscott/testing-conventions/.github/workflows/testing-conventions.yml@v0 with: @@ -30,12 +21,3 @@ jobs: config: testing-conventions.toml base: ${{ github.event.pull_request.base.sha || 'origin/main' }} gates: '["colocated-test", "unit-lint", "integration-lint", "mutation", "packaging"]' - - rust-napi-binding: - uses: thekevinscott/testing-conventions/.github/workflows/testing-conventions.yml@v0 - with: - languages: '["rust"]' - source: packages/ts/napi - config: testing-conventions.toml - base: ${{ github.event.pull_request.base.sha || 'origin/main' }} - gates: '["colocated-test", "unit-lint"]' diff --git a/.github/workflows/ts-test.yml b/.github/workflows/dirsql-typescript-ci.yml similarity index 66% rename from .github/workflows/ts-test.yml rename to .github/workflows/dirsql-typescript-ci.yml index 6620f67a9..3ee1818fa 100644 --- a/.github/workflows/ts-test.yml +++ b/.github/workflows/dirsql-typescript-ci.yml @@ -1,8 +1,14 @@ -name: TS Test - -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - +name: dirsql TypeScript CI + +# All PR verification for the TypeScript SDK (packages/ts): biome lint, tsc +# typecheck, the napi build + four test tiers, and the testing-conventions +# gate suites for the SDK and the napi binding crate. Merged from ts-lint.yml, +# ts-typecheck.yml, ts-test.yml and two conventions.yml lanes so one paths +# filter governs the whole set. +# +# packages/rust/** fans in: the core compiles into the binding, and +# [e2e].extra_scope means a core change stales this package's attestation. +# No self-path on pull_request, per the #834 stack convention. on: push: branches: [main] @@ -11,16 +17,110 @@ on: - 'packages/rust/**' - 'Cargo.toml' - 'Cargo.lock' - - '.github/workflows/ts-test.yml' + - 'testing-conventions.toml' + - '.github/workflows/dirsql-typescript-ci.yml' pull_request: paths: - - '.github/CI-DISABLED-PLACEHOLDER' + - 'packages/ts/**' + - '!packages/ts/changelog.d/**' + - '!packages/ts/migrations.d/**' + - '!packages/ts/README.md' + - 'packages/rust/**' + - '!packages/rust/changelog.d/**' + - '!packages/rust/migrations.d/**' + - '!packages/rust/README.md' + - 'Cargo.toml' + - 'Cargo.lock' + - 'testing-conventions.toml' + - '.github/workflows/dirsql-typescript-ci.yml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: + # Job ids `typescript-sdk` / `rust-napi-binding` kept from their + # conventions.yml lanes so check-run names are unchanged. + typescript-sdk: + uses: thekevinscott/testing-conventions/.github/workflows/testing-conventions.yml@v0 + with: + languages: '["typescript"]' + source: packages/ts/src + config: testing-conventions.toml + base: ${{ github.event.pull_request.base.sha || 'origin/main' }} + rust_toolchain: true + + rust-napi-binding: + uses: thekevinscott/testing-conventions/.github/workflows/testing-conventions.yml@v0 + with: + languages: '["rust"]' + source: packages/ts/napi + config: testing-conventions.toml + base: ${{ github.event.pull_request.base.sha || 'origin/main' }} + gates: '["colocated-test", "unit-lint"]' + + lint: + name: lint (ts) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: "24" + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 11 + + - name: Install dependencies + working-directory: packages/ts + run: pnpm install + + - name: Lint + working-directory: packages/ts + run: pnpm lint + + - name: Format check + working-directory: packages/ts + run: pnpm format:check + +# `tsc` already runs as part of `pnpm build` in `ts-test.yml`, so this is +# redundant in the strict sense. It exists for the same reason +# `python-typecheck.yml` does: a dedicated, fast-failing type-check signal +# that doesn't require the napi-rs build chain (~seconds instead of minutes) +# and shows up as its own red check rather than "Unit tests" failing on a +# pure type error. The native addon is loaded at runtime via `createRequire` +# (see `src/load-native-core.ts`), so `tsc --noEmit` does not need +# `dirsql.node` or the generated `index.d.ts` to succeed. + tsc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: "24" + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 11 + + - name: Install dependencies + working-directory: packages/ts + run: pnpm install + + - name: Type check + working-directory: packages/ts + run: pnpm exec tsc --noEmit + build: # Builds the napi addon once and shares it with unit/binding/distcheck below # (#483) instead of each job/matrix-cell rebuilding it independently. @@ -207,7 +307,7 @@ jobs: # asserts no test files ship in the artifact). No mocks. The flow lives # in the internals/distcheck package (#520); this job invokes its # `dirsql-distcheck node` entry point (which drives npm/pnpm from Python). - name: Packaging distcheck (install + run) + name: Packaging distcheck (ts) needs: build runs-on: ubuntu-latest steps: diff --git a/.github/workflows/ts-lint.yml b/.github/workflows/ts-lint.yml deleted file mode 100644 index 80b33c093..000000000 --- a/.github/workflows/ts-lint.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: TS Lint - -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - -on: - push: - branches: [main] - paths: - - 'packages/ts/**/*.ts' - - 'packages/ts/**/*.js' - - 'packages/ts/biome.json' - - 'packages/ts/package.json' - pull_request: - paths: - - '.github/CI-DISABLED-PLACEHOLDER' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: "24" - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 11 - - - name: Install dependencies - working-directory: packages/ts - run: pnpm install - - - name: Lint - working-directory: packages/ts - run: pnpm lint - - - name: Format check - working-directory: packages/ts - run: pnpm format:check diff --git a/.github/workflows/ts-typecheck.yml b/.github/workflows/ts-typecheck.yml deleted file mode 100644 index fba5aeb11..000000000 --- a/.github/workflows/ts-typecheck.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: TS Typecheck - -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - -on: - push: - branches: [main] - paths: - - 'packages/ts/**/*.ts' - - 'packages/ts/tsconfig.json' - - 'packages/ts/package.json' - pull_request: - paths: - - '.github/CI-DISABLED-PLACEHOLDER' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# `tsc` already runs as part of `pnpm build` in `ts-test.yml`, so this is -# redundant in the strict sense. It exists for the same reason -# `python-typecheck.yml` does: a dedicated, fast-failing type-check signal -# that doesn't require the napi-rs build chain (~seconds instead of minutes) -# and shows up as its own red check rather than "Unit tests" failing on a -# pure type error. The native addon is loaded at runtime via `createRequire` -# (see `src/load-native-core.ts`), so `tsc --noEmit` does not need -# `dirsql.node` or the generated `index.d.ts` to succeed. -jobs: - tsc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: "24" - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 11 - - - name: Install dependencies - working-directory: packages/ts - run: pnpm install - - - name: Type check - working-directory: packages/ts - run: pnpm exec tsc --noEmit