Skip to content

ci: add golangci-lint, cross-platform build, and actionlint - #6

Open
AskAlexSharov wants to merge 1 commit into
mainfrom
alex/add_ci
Open

ci: add golangci-lint, cross-platform build, and actionlint#6
AskAlexSharov wants to merge 1 commit into
mainfrom
alex/add_ci

Conversation

@AskAlexSharov

@AskAlexSharov AskAlexSharov commented Aug 13, 2026

Copy link
Copy Markdown

The repo had no CI at all. This adds three checks.

Both Go files are cgo wrappers over the vendored evmone/intx C++ sources, which shapes every choice here: the jobs run with CGO_ENABLED=1, and they pin a current Go toolchain rather than using go-version-file, because go.mod declares go 1.17 as the module minimum and that is too old to run golangci-lint v2.

job runs
lint golangci-lint v2.12.2
build go build / go vet / go test on ubuntu-latest and macos-latest
actionlint lints these workflow files

Lint config. Standard linter set plus misspell, unconvert, usestdlibvars, and govet's unsafeptr — the package is entirely unsafe.Pointer conversions into C++, so that one is the most relevant check in the repo. gofmt and goimports are declared as v2 formatters; golangci-lint run fails on unformatted files too, so no separate gofmt step is needed.

Why both platforms. cgo with -std=c++20 resolves differently under gcc and clang, and this is a header-only include of vendored C++. A build that passes on one says little about the other.

No dependency cache. The module has no dependencies and no go.sum, so setup-go has nothing to key a cache on; cache: false avoids a spurious warning.

Verified

All four checks pass on this PR: lint, build (ubuntu-latest), build (macos-latest), actionlint — 32s total. That includes the Linux cgo/C++20 leg, which I could not run locally (no Docker), so the vendored headers do resolve from the -I paths already in the #cgo CXXFLAGS under gcc as well as clang.

golangci-lint reports 0 issues against the current tree.

Not included

No go test coverage gate, since the repo has no Go tests yet — the step is wired so it starts counting the moment one lands. The C++ side (CMake, the evmone submodule tree) is untouched; this covers the Go binding only.

The repo had no CI. Both Go files are cgo wrappers over the vendored
evmone/intx C++ sources, so the checks build with CGO_ENABLED=1 and a
current toolchain -- go.mod declares go 1.17 only as the module minimum,
which is too old to run golangci-lint v2.

- lint: golangci-lint v2.12.2 (standard set + misspell, unconvert,
  usestdlibvars, and govet's unsafeptr, since the package is entirely
  unsafe.Pointer conversions into C++). gofmt/goimports run as v2
  formatters, so `run` fails on unformatted files too.
- build: go build/vet/test on ubuntu-latest and macos-latest. cgo with
  -std=c++20 resolves differently under gcc and clang, so both matter.
- actionlint: lints these workflows.

Verified locally on macOS: golangci-lint reports 0 issues, and actionlint
accepts the workflow. The Linux leg runs here for the first time.
@AskAlexSharov
AskAlexSharov marked this pull request as ready for review August 13, 2026 03:36
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