Skip to content

ci: add pull_request/push:main workflow - #21

Merged
shreyanshjain7174 merged 5 commits into
mainfrom
ci/pull-request-checks
Aug 19, 2026
Merged

ci: add pull_request/push:main workflow#21
shreyanshjain7174 merged 5 commits into
mainfrom
ci/pull-request-checks

Conversation

@shreyanshjain7174

Copy link
Copy Markdown
Contributor

T2 from the release-engineering queue. release.yml (from #19) only triggers on push: tags: v* — pull requests currently get zero validation. Six good first issue tickets invite outside contributors, and their PRs would run nothing.

Adds .github/workflows/ci.yml:

  • Triggers: pull_request (any branch) + push to main.
  • go build ./..., go vet ./..., go test ./... -race, gofmt -l . (fails the job if it outputs anything), go mod tidy + git diff --exit-code go.mod go.sum (fails on dependency drift).
  • Go version read from go.mod, not hardcoded.
  • Installs gcc + libsqlite3-dev since main still uses the CGO mattn/go-sqlite3 driver as of this PR. Commented in the file: drop that step and set CGO_ENABLED=0 once feat(deps): replace mattn/go-sqlite3 with modernc.org/sqlite (pure Go) #20 (pure-Go sqlite driver swap) merges.

Adds the CI badge to README.md.

Every command verified locally against current main before opening this PR (build/vet/race-test/gofmt all clean, go mod tidy produces no diff) — but per the actual acceptance criterion, that's not the point. The point is that this fires on the PR itself. Will follow up with the live check run link once it completes.

@shreyanshjain7174

Copy link
Copy Markdown
Contributor Author

First green check run, on this exact branch after fixing two real issues found along the way (not on a local-only pass): https://github.com/Clawdlinux/agentgate/actions/runs/32234523106

All steps: Install sqlite build dependenciesgo buildgo vetgo test -racegofmtgo mod tidy drift check — all success.

Fixed after the first live run actually surfaced it: the first run hung 10+ minutes with zero log output mid apt-get update — a genuine network stall fetching package indices from archive.ubuntu.com, confirmed by checking the actual log timestamps rather than guessing. Wrapped both apt-get calls in a 120s timeout with up to 3 retry attempts.

…gofmt, mod-tidy drift check

Adds .github/workflows/ci.yml. PR #19's release.yml only triggers on
tag push, so pull requests currently get zero validation - six good
first issue tickets invite outside contributors and their PRs would
run nothing.

Installs gcc + libsqlite3-dev since main still uses the CGO
mattn/go-sqlite3 driver as of this commit; comments in the file note
to drop that step and set CGO_ENABLED=0 once PR #20 (pure-Go sqlite
driver swap) merges.

Adds the CI status badge to README.md.

Every step verified locally against current main before opening this
PR: go build, go vet, go test -race, gofmt -l (clean), and go mod
tidy produces no diff. The actual acceptance criterion is that this
fires green on the PR itself, not on local runs - see the PR
description for the live check run link.

Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
First live run hung 10+ minutes on 'Install sqlite build dependencies'
- almost certainly needrestart/debconf prompting interactively on a
sudo apt-get install with no noninteractive frontend set. Cancelled
that run (32233234510) and fixed rather than reporting the earlier
local-only pass as done.

Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
Run 32233234510's 'Install sqlite build dependencies' step went silent
for over 10 minutes mid apt-get update (checked the actual log
timestamps - real network stall fetching package indices, not a
debconf prompt, not a lock). Wraps both apt-get calls in a 120s
timeout with up to 3 attempts so a future transient mirror stall
fails fast and retries instead of hanging the whole job.

Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
github.com//pull/20 replaced mattn/go-sqlite3 with
the pure-Go modernc.org/sqlite. No more gcc/libsqlite3-dev needed, no
more apt-get retry wrapper for the network stall that only existed to
install those. Set CGO_ENABLED=0 globally instead.

Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
go test -race genuinely requires cgo on linux (confirmed via a real
failing CI run: 'go: -race requires cgo; enable cgo by setting
CGO_ENABLED=1'), independent of whatever sqlite driver is in use.
ubuntu-latest ships gcc via build-essential, so this needs no apt-get
step -- unlike the old libsqlite3-dev requirement this file used to
work around.

Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
@shreyanshjain7174

shreyanshjain7174 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto #20 (merged as 46f27b2) and simplified: dropped the apt-get install gcc libsqlite3-dev step and the retry wrapper entirely, CGO_ENABLED=0 at job level.

Caught one real thing doing this: go test -race fails outright without cgo (go: -race requires cgo; enable cgo by setting CGO_ENABLED=1) — confirmed via an actual failing CI run, not assumed. Fixed by setting CGO_ENABLED=1 on just that step. No apt-get needed for it since ubuntu-latest ships gcc via build-essential by default; the old apt-get step was only ever for libsqlite3-dev, which is gone now.

First push failed on the -race/cgo issue: https://github.com/Clawdlinux/agentgate/actions/runs/32290878041
Fixed follow-up passed in 1m51s: https://github.com/Clawdlinux/agentgate/actions/runs/32291079119

Merging.

@shreyanshjain7174
shreyanshjain7174 merged commit 4119274 into main Aug 19, 2026
1 check passed
@shreyanshjain7174
shreyanshjain7174 deleted the ci/pull-request-checks branch August 19, 2026 19:09
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