Skip to content

chore(ci): add PR workflow for build, typecheck, format & test - #1797

Merged
mihar-22 merged 1 commit into
mainfrom
ci/add-pr-checks
May 25, 2026
Merged

chore(ci): add PR workflow for build, typecheck, format & test#1797
mihar-22 merged 1 commit into
mainfrom
ci/add-pr-checks

Conversation

@mihar-22

Copy link
Copy Markdown
Member

Summary

Adds a GitHub Actions workflow that runs on every pull request and push to main. Validates the full pipeline:

  1. Format checkoxfmt --check across both packages
  2. Typechecktsgo --noEmit against tsconfig.json in each package
  3. Buildtsdown JS bundles + tsgo-generated bundled .d.ts declarations via turbo
  4. Testvitest --run

Workflow design

  • Triggers: pull_request to main + push to main (so the main branch is also continuously validated)
  • Single job, sequential steps: each step fails fast on errors. Splitting into parallel jobs would re-install deps + re-build for each, which is wasteful for such a fast pipeline (~25s end-to-end based on local runs)
  • Concurrency: cancels in-progress runs on the same PR when new commits land
  • Node 22 (required by tsdown >= 22.18) — was previously 18 in the weekly workflow
  • pnpm 8.7.0 to match packageManager field
  • pnpm install --frozen-lockfile to catch lockfile drift

Additional changes

  • Added format:check script to root (turbo run format:check --parallel) and both packages (oxfmt --check src)
  • Added format:check turbo task with the same inputs as format

Why not put format/typecheck in separate jobs?

The full pipeline runs in ~25 seconds locally, which is fast enough that the overhead of duplicate pnpm install (~30-60s) across parallel jobs would actually be slower. A single job that fails fast is the right tradeoff here.

Local verification

Step Time
pnpm format:check ~1.2s
pnpm typecheck ~1s
pnpm build ~5s
pnpm test ~2s

🤖 Generated with opencode

Adds a GitHub Actions workflow that runs on pull_request and push to
main. The workflow runs the full validation pipeline:

  1. format:check (oxfmt --check)
  2. typecheck (tsgo --noEmit)
  3. build (tsdown via turbo)
  4. test (vitest)

Steps run sequentially within a single job so later steps fail fast on
earlier errors. In-progress runs on the same PR are cancelled when new
commits are pushed.

Also adds:
- `format:check` script to root and both packages
- `format:check` turbo task

Node 22 is used (required by tsdown >= 22.18) with pnpm 8.7.0 to match
the packageManager field. Dependencies are installed with
--frozen-lockfile to catch lockfile drift.
@mihar-22 mihar-22 changed the title ci: add PR workflow for build, typecheck, format & test chore(ci): add PR workflow for build, typecheck, format & test May 25, 2026
@mihar-22
mihar-22 marked this pull request as ready for review May 25, 2026 04:14
@mihar-22
mihar-22 merged commit c60bb1a into main May 25, 2026
1 check passed
@mihar-22
mihar-22 deleted the ci/add-pr-checks branch May 25, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant