F-11: Forgejo Actions CI (bookshelf-qqz.11) #5

Merged
zombor merged 5 commits from bd-bookshelf-qqz.11 into main 2026-05-20 17:43:38 +00:00
Owner

Summary

  • Adds .forgejo/workflows/ci.yml with three jobs: lint (go vet + golangci-lint), test (MySQL 8 service container + make test with race detector), and coverage (make coverage enforcing the 100% gate), triggered on push to main and PR open/sync.
  • Adds .golangci.yml enabling govet, errcheck, staticcheck, ineffassign, unused, gosimple; excludes internal/db/sqlc/ (generated) and *_mock.go files.
  • Wires golangci-lint run into make lint in the Makefile.

Test Plan

  • Push a commit to main or open a PR — all three CI jobs should run and pass.
  • Intentionally lower coverage in a feature branch (e.g. delete a test) — the coverage job should fail.
  • Introduce a lint error (e.g. unused variable) — the lint job should fail.
  • Confirm MySQL 8 service healthcheck starts correctly and tests connect via BOOKSHELF_DSN.

Forgejo Quirks Documented

See top-of-file comments in ci.yml: action references use GitHub Marketplace via runner allow-list; fallback manual install instructions included if GitHub-hosted actions are blocked.

Closes bead bookshelf-qqz.11 on merge.

## Summary - Adds `.forgejo/workflows/ci.yml` with three jobs: **lint** (go vet + golangci-lint), **test** (MySQL 8 service container + `make test` with race detector), and **coverage** (`make coverage` enforcing the 100% gate), triggered on push to main and PR open/sync. - Adds `.golangci.yml` enabling govet, errcheck, staticcheck, ineffassign, unused, gosimple; excludes `internal/db/sqlc/` (generated) and `*_mock.go` files. - Wires `golangci-lint run` into `make lint` in the Makefile. ## Test Plan - [ ] Push a commit to main or open a PR — all three CI jobs should run and pass. - [ ] Intentionally lower coverage in a feature branch (e.g. delete a test) — the **coverage** job should fail. - [ ] Introduce a lint error (e.g. unused variable) — the **lint** job should fail. - [ ] Confirm MySQL 8 service healthcheck starts correctly and tests connect via `BOOKSHELF_DSN`. ## Forgejo Quirks Documented See top-of-file comments in `ci.yml`: action references use GitHub Marketplace via runner allow-list; fallback manual install instructions included if GitHub-hosted actions are blocked. Closes bead bookshelf-qqz.11 on merge.
F-11: add Forgejo Actions CI workflow and golangci-lint config
Some checks failed
/ Test (pull_request) Failing after 59s
/ Coverage (pull_request) Has been skipped
/ Lint (pull_request) Failing after 1m11s
a0ce287437
- .forgejo/workflows/ci.yml: three jobs (lint, test, coverage) triggered on
  push to main and PR open/sync. Go version from go.mod via setup-go@v5.
  Test and coverage jobs spin up MySQL 8 service container with healthcheck
  and pass BOOKSHELF_DSN for future integration tests.
- .golangci.yml: enables govet, errcheck, staticcheck, ineffassign, unused,
  gosimple; excludes internal/db/sqlc/ and *_mock.go files.
- Makefile: wire golangci-lint into `make lint` target.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix CI: install ginkgo, unpin golangci-lint version
Some checks failed
/ Lint (pull_request) Failing after 1m2s
/ Test (pull_request) Successful in 2m6s
/ Coverage (pull_request) Successful in 1m9s
95ede9430d
- Lint failed because pinned golangci-lint v1.64.8 was built with
  Go 1.24 but go.mod targets 1.26.1. Switch to `version: latest`
  so the action picks a build compatible with the project's Go.
- Test failed because the runner image had no ginkgo CLI on PATH.
  Add `go install github.com/onsi/ginkgo/v2/ginkgo` to the test job
  so `make test` (which calls `ginkgo` directly) works.

Coverage job uses `go test` via scripts/check-coverage.sh and does
not need the ginkgo binary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zombor force-pushed bd-bookshelf-qqz.11 from 95ede9430d
Some checks failed
/ Lint (pull_request) Failing after 1m2s
/ Test (pull_request) Successful in 2m6s
/ Coverage (pull_request) Successful in 1m9s
to f3258a4c1c
Some checks failed
/ Lint (pull_request) Has been cancelled
/ Test (pull_request) Has been cancelled
/ Coverage (pull_request) Has been cancelled
2026-05-20 17:27:51 +00:00
Compare
Remove unused .golangci.yml (lint deferred to follow-up bead)
Some checks failed
/ Test (pull_request) Failing after 1s
/ Coverage (pull_request) Has been skipped
/ Lint (pull_request) Successful in 56s
b2f3c54ee1
ci: use port 3307 for MySQL service to avoid host port 3306 conflict
All checks were successful
/ Lint (pull_request) Successful in 50s
/ Test (pull_request) Successful in 1m10s
/ Coverage (pull_request) Successful in 1m6s
242645f9a7
The runner already has MySQL bound to port 3306 (likely a system service),
so binding 3306:3306 fails with "port is already allocated". Switch to
3307:3306 on the host side and update both Test and Coverage job DSNs to
connect via 127.0.0.1:3307.
zombor merged commit 5103f5dfed into main 2026-05-20 17:43:38 +00:00
zombor referenced this pull request from a commit 2026-05-20 17:43:40 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zombor/pergamum!5
No description provided.