Skip to content

chore: set up CI (typecheck + lint + test on PR and push)#28

Open
LeslieOA wants to merge 1 commit into
developfrom
chore/ci-workflow
Open

chore: set up CI (typecheck + lint + test on PR and push)#28
LeslieOA wants to merge 1 commit into
developfrom
chore/ci-workflow

Conversation

@LeslieOA

Copy link
Copy Markdown
Member

Summary

Three parallel jobs (typecheck, lint, test) on every PR against develop and every push to develop. Node 20, npm ci with cache, no matrix.

What's NOT in this PR (manual follow-up)

Branch protection on develop requiring all three checks to pass before merge. Can't be encoded in the repo — has to be set via the repo settings UI or:

gh api -X PUT repos/workspace-sh/react-native-jsoncanvas/branches/develop/protection \
  --input - <<'JSON'
{
  "required_status_checks": {
    "strict": true,
    "contexts": ["Typecheck", "Lint", "Test"]
  },
  "enforce_admins": false,
  "required_pull_request_reviews": null,
  "restrictions": null
}
JSON

I'd leave enforce_admins: false so genuine emergency force-merges by the maintainer don't require disabling protection first.

What CI will actually run

On develop HEAD right now: 38/38 tests, clean typecheck, lint exit 0. So this PR should be green on its first run. Once merged, every subsequent PR (starting with #27) gets the same gate.

Concurrency

Superseded PR runs cancel automatically — saves runner minutes during review cycles. Pushes to develop don't cancel; they complete to publish status correctly.

Test plan

  • CI workflow runs on this PR
  • All three jobs pass
  • Branch protection enabled (manual, post-merge)

Refs: #8

GitHub Actions workflow at .github/workflows/ci.yml. Runs on every PR
against develop and every push to develop. Three parallel jobs:
typecheck (tsc --noEmit), lint (eslint src), test (jest). Node 20 matches
package.json's engines field and Workspace's toolchain. Single Node
version on purpose — adding a 22/24 matrix triples runner minutes for
negligible value at this scale.

Concurrency group cancels superseded runs on the same PR ref. Pushes to
develop don't cancel (they should always complete to publish status).

Manual follow-up (can't encode in repo): set up branch protection on
develop requiring Typecheck / Lint / Test contexts before merge. Command
in the PR description.

Refs: #8

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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