chore: add CI test workflow for PRs - #2
Merged
Merged
Conversation
Runs on every pull_request and on push to main, in a Node 20/22 matrix. Three steps: npm ci, npm run build:harness (which is the harness's typecheck-and-compile), npm test. The new test script wraps node --test test/*.mjs so contributors and CI use the same entry point. concurrency: cancel-in-progress keeps stale runs from blocking new pushes on a PR. Pair this with branch protection on main to gate merges on a green run. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an automated test gate for PRs and main pushes.
.github/workflows/test.yml— runs onpull_requestandpushtomain, Node 20/22 matrix, ~1-2 min per legnpm ci→npm run build:harness(compile + typecheck the harness) →npm testnpm test: new script wrappingnode --test test/*.mjsso contributors and CI share one entry pointcancel-in-progresson the same ref so stale runs don't pile upActivating the gate
The workflow runs automatically on PRs once this lands. To make it block merges, enable branch protection on
main:```bash
gh api -X PUT repos/hyspacex/harness-cli/branches/main/protection \
-F required_status_checks[strict]=true \
-F 'required_status_checks[contexts][]=test (20)' \
-F 'required_status_checks[contexts][]=test (22)' \
-F enforce_admins=true \
-F required_pull_request_reviews= \
-F restrictions=
```
Or via the web UI: Settings → Branches → Add rule → require status checks
test (20)andtest (22).Test plan
npm testruns locally (11/11 on main)npm ciresolves cleanly (uses existingpackage-lock.json)🤖 Generated with Claude Code