ci: add pull_request/push:main workflow - #21
Conversation
|
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: Fixed after the first live run actually surfaced it: the first run hung 10+ minutes with zero log output mid |
…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>
68b2348 to
2eb53d9
Compare
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>
|
Rebased onto #20 (merged as Caught one real thing doing this: First push failed on the -race/cgo issue: https://github.com/Clawdlinux/agentgate/actions/runs/32290878041 Merging. |
T2 from the release-engineering queue.
release.yml(from #19) only triggers onpush: tags: v*— pull requests currently get zero validation. Sixgood first issuetickets invite outside contributors, and their PRs would run nothing.Adds
.github/workflows/ci.yml:pull_request(any branch) +pushtomain.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.mod, not hardcoded.gcc+libsqlite3-devsincemainstill uses the CGOmattn/go-sqlite3driver as of this PR. Commented in the file: drop that step and setCGO_ENABLED=0once 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
mainbefore opening this PR (build/vet/race-test/gofmt all clean,go mod tidyproduces 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.