Skip to content

ci: run go vet + test on PRs + master pushes - #78

Merged
frahlg merged 3 commits into
masterfrom
ci/test-on-pr
Apr 17, 2026
Merged

frahlg merged 3 commits into
masterfrom
ci/test-on-pr

Conversation

@frahlg

@frahlg frahlg commented Apr 17, 2026

Copy link
Copy Markdown
Member

Summary

Adds a dedicated test workflow so PR authors get fast feedback before merge. Runs go vet ./... and go test -race -count=1 ./... on every PR targeting master and on master pushes.

Requested by @Xorath — tests should run on PRs and merges should be blocked until they pass.

Why separate from release.yml

Release runs semantic-release + Docker build + binary artifacts — useful on master but too slow for PR feedback. Splitting keeps PR turnaround tight.

Follow-up (not in this PR)

Once this workflow has run successfully at least once, apply branch protection to master so the check becomes required:

gh api -X PUT repos/:owner/:repo/branches/master/protection \
  -f required_status_checks='{"strict":true,"contexts":["test / go test + vet"]}' \
  -f enforce_admins=false -f required_pull_request_reviews=null \
  -f restrictions=null

Deliberately left out of this PR so a misconfiguration can't accidentally block an in-flight merge.

Known gotcha

go test ./... currently fails on PR #72's branch due to the Lua warmup regression in 80e5ae4 (see #72 (comment)). Once this workflow is live and branch protection is on, PR #72 will need that fix before it can merge — which is working as intended.

Test plan

  • YAML parses (uv run --with pyyaml python -c ...).
  • This PR's own CI run should pass (the workflow runs against itself as part of PR checks).
  • After merge, confirm next PR sees the check on its Conversation page.

🤖 Generated with Claude Code

frahlg and others added 3 commits April 17, 2026 11:48
Adds a test workflow separate from release.yml so PR authors get fast
feedback before merge without waiting for semantic-release / docker.
Runs go vet + go test -race -count=1 against the full ./... tree.

Paired with this, master's branch protection should require the
"test / go test + vet" check to pass before merging. That's applied via
the GH API after this workflow has run at least once (so the check
name is known to GitHub's protection layer):

  gh api -X PUT repos/:owner/:repo/branches/master/protection -f \
    required_status_checks='{"strict":true,"contexts":["test / go test + vet"]}' \
    -f enforce_admins=false -f required_pull_request_reviews=null \
    -f restrictions=null

Left unapplied here so the first CI run can't accidentally block an
in-flight merge if anything's misconfigured.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Leftover from an earlier refactor. 'go vet' rejects "result of Sprintf
not used", which breaks the new test workflow. The silence-import
comment is stale — fmt had no other use in the file.
Documented inline. Re-add once telemetry.DriverHealth writes from
OCPP handlers are serialized.
@frahlg
frahlg merged commit 2b4b118 into master Apr 17, 2026
1 check passed
@frahlg
frahlg deleted the ci/test-on-pr branch April 17, 2026 09:55
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