Skip to content

ci: add GitHub Actions workflow with golangci-lint - #1

Open
AskAlexSharov wants to merge 1 commit into
mainfrom
ci/add-golangci-lint
Open

ci: add GitHub Actions workflow with golangci-lint#1
AskAlexSharov wants to merge 1 commit into
mainfrom
ci/add-golangci-lint

Conversation

@AskAlexSharov

@AskAlexSharov AskAlexSharov commented Jul 23, 2026

Copy link
Copy Markdown

What

Adds continuous integration for the module. There was no CI before this PR.

Two jobs, triggered on push to main and on every pull request:

test

  • go build, go vet, and go test -race -count=1
  • Matrix across Go 1.21 (the go.mod minimum) and 1.26 (latest)
  • CGO_ENABLED=1 is set explicitly — this is a cgo package (the bundled libdeflate C sources are compiled at build time), so every step needs a C toolchain. ubuntu-latest ships gcc.

lint

  • golangci-lint v2.12.2 via golangci/golangci-lint-action@v9, on Go 1.26.

Lint config (.golangci.yml, v2 schema)

Uses the standard linter set (errcheck, govet, ineffassign, staticcheck, unused) plus misspell, unconvert, revive, bodyclose, nilerr, with gofmt/goimports as formatters.

Validated locally with golangci-lint v2.12.2 — config verify passes and run reports 0 issues against the current tree, so CI is green from the first run. The vendored libdeflate/ C directory contains no Go and is excluded defensively.

Notes

  • Action and tool versions are pinned to current majors (checkout v7, setup-go v7, golangci-lint-action v9); bump them as the project moves forward.

Adds CI that runs on push to main and on pull requests:

- test job: build, vet, and `go test -race` on Go 1.21 (go.mod minimum)
  and 1.26 (latest). CGO_ENABLED is pinned to 1 since the libdeflate C
  sources are compiled at build time and need a C toolchain (present on
  ubuntu-latest).
- lint job: golangci-lint v2.12.2 via golangci-lint-action@v9, on Go 1.26.

The .golangci.yml (v2 schema) uses the standard linter set (errcheck,
govet, ineffassign, staticcheck, unused) plus misspell, unconvert, revive,
bodyclose and nilerr, with gofmt/goimports as formatters. Verified with
`golangci-lint config verify` and green against the current tree.
@AskAlexSharov
AskAlexSharov force-pushed the ci/add-golangci-lint branch from f69bd5c to 682bb37 Compare July 24, 2026 02:19
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.

2 participants