Skip to content

ci: add GitHub Actions workflow for typecheck, build, and tests - #41

Open
slegarraga wants to merge 1 commit into
zanni098:mainfrom
slegarraga:ci/github-actions
Open

ci: add GitHub Actions workflow for typecheck, build, and tests#41
slegarraga wants to merge 1 commit into
zanni098:mainfrom
slegarraga:ci/github-actions

Conversation

@slegarraga

Copy link
Copy Markdown
Contributor

CI: GitHub Actions workflow (typecheck + build + tests)

Closes #19.

What

A single ci.yml workflow that runs on pushes to main and on every PR, across a Node 20 and 22 matrix:

  1. npm ci
  2. Typecheck: npx tsc -b
  3. Production build: npm run build (which itself runs tsc -b && vite build)
  4. Tests: npm run --if-present test

Plus two small quality-of-life details: npm caching via actions/setup-node, and a concurrency group (${{ github.workflow }}-${{ github.ref }}, cancel-in-progress) so pushing a new commit to an open PR cancels its superseded run instead of queueing both.

Why the test step uses --if-present

There is no test script on main yet; #39 adds Vitest with "test": "vitest run". With this flag the job is fully green on main today (the step skips), and the moment #39 merges the same workflow picks up the suite with zero coordination or edits needed. I verified both sides of that bridge locally:

Validation

All executed locally against this exact tree before opening the PR:

The first real Actions run will confirm the hosted path once this PR opens.

Runs npm ci, tsc -b, npm run build, and npm run --if-present test on
pushes to main and every PR, across Node 20 and 22, with npm caching
and a concurrency group that cancels superseded runs.

Closes zanni098#19
@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

@slegarraga is attempting to deploy a commit to the zanni098's projects Team on Vercel.

A member of the Team first needs to authorize it.

@zanni098

Copy link
Copy Markdown
Owner

Workflow looks right — green on this PR, and it's the CI setup we want. One change before merge:

Drop Node 20 from the matrix (keep 22, optionally add 24). Once #39 lands with jsdom 30 / jest-dom 7, those need a newer Node — this PR's green runs predate that bump, so they don't prove Node 20 compatibility once both merge. If 20 stays in the matrix, main goes red as soon as both are in.

Ping me when that's pushed and I'll merge.

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.

Add GitHub Actions CI workflow (build + typecheck + test on PR)

2 participants