Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

ci: add build, lint and typecheck workflow - #33

Merged
fabianzimber merged 2 commits into
mainfrom
ci/add-build-lint-typecheck-workflow
Aug 31, 2026
Merged

fabianzimber merged 2 commits into
mainfrom
ci/add-build-lint-typecheck-workflow

Conversation

@fabianzimber

Copy link
Copy Markdown
Member

Why

The repo only runs CodeQL. Dependency changes therefore merge without ever being compiled, linted, or typechecked.

That is exactly how PR #10 reached main: it bumped react-dom to 19.2.8 while react stayed at 19.2.4, and [email protected] requires peer react@"^19.2.8". Every check stayed green while npm ci failed outright with ERESOLVE and no dependency tree could be resolved at all. It was only caught by running the checks by hand afterwards.

What

Two jobs:

web — on Node 22 (the version pinned in web/Dockerfile), with npm cache keyed on web/package-lock.json:

  1. npm ci
  2. npm run lint
  3. npm run typecheck
  4. npm run build

terraform — in infra/terraform/aws on Terraform 1.14.0:

  1. terraform fmt -check -recursive
  2. terraform init -backend=false
  3. terraform validate

Notes on choices:

  • npm ci, not npm install — installs exactly what the lockfile pins and fails on an unresolvable tree. This is the check that would have caught chore(deps): bump react-dom and @types/react-dom in /web #10.
  • init -backend=false — this repo has no backend and no deployed infrastructure. Validating config only, so the job needs no AWS credentials and cannot reach real AWS APIs.
  • TypeScript stays on 5 — tsc --noEmit passes, and typescript-eslint (via eslint-config-next) does not support TS 7 yet, so the lint step would break.
  • Concurrency group cancels superseded runs, which matters once Dependabot opens several PRs at once.

Also adds a typecheck script (tsc --noEmit) to web/package.json so the check is identical locally and in CI.

Verification

Check Result
npm run typecheck pass
npm run lint pass
npm run build pass
terraform fmt -check -recursive pass
terraform validate pass
workflow YAML parses pass (2 jobs: web, terraform)

The GitHub Actions run on this PR is itself the remaining proof — web and terraform should both go green.

Follow-ups after this

The repo only runs CodeQL, so dependency changes merge without ever being
compiled. That is how PR #10 reached main: it bumped react-dom to 19.2.8
while react stayed at 19.2.4, and react-dom 19.2.8 requires
`peer react@"^19.2.8"`. Every check stayed green while `npm ci` failed
outright with ERESOLVE and no dependency tree could be resolved.

Adds a CI workflow with two jobs:

- web: `npm ci`, lint, typecheck, build on Node 22 (the version used by
  web/Dockerfile), with npm cache keyed on the lockfile.
- terraform: `terraform fmt -check -recursive` and `terraform validate`.

`npm ci` is used rather than `npm install` so CI installs exactly what the
lockfile pins and fails on an unresolvable tree.

The terraform job runs `init -backend=false` and validates config only. This
repo has no backend and no deployed infrastructure, so the job needs no AWS
credentials and cannot reach real AWS APIs.

Also adds a `typecheck` script (`tsc --noEmit`) so the check runs identically
locally and in CI.
- Explicitly set permissions: contents: read at the workflow level so
  both jobs run with the minimum required access (default is broader).
- Add timeout-minutes: 20 to the web job and 10 to the terraform job
  to prevent hung builds from burning runner minutes.
@fabianzimber
fabianzimber merged commit bbb8ae0 into main Aug 31, 2026
6 checks passed
@fabianzimber
fabianzimber deleted the ci/add-build-lint-typecheck-workflow branch August 31, 2026 18:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant