Skip to content

ci: optimize build configuration for faster CI and release builds#164

Open
marcus wants to merge 1 commit into
codex/lint-fix-linter-fixesfrom
build-optimize-ci-config
Open

ci: optimize build configuration for faster CI and release builds#164
marcus wants to merge 1 commit into
codex/lint-fix-linter-fixesfrom
build-optimize-ci-config

Conversation

@marcus
Copy link
Copy Markdown
Owner

@marcus marcus commented May 14, 2026

Summary

Config-only build time optimization — no source changes. The biggest wins are in CI, where the toolchain version mismatch and unpinned tooling caused cache misses and re-downloads on every run.

Changes

  • ci.ymltest and lint jobs now use go-version-file: go.mod instead of a hardcoded 1.23, so the CI toolchain matches the module's go 1.24.0 requirement (the mismatch previously forced toolchain re-downloads and invalidated caches).
  • ci.yml — explicit setup-go module/build caching enabled (cache: true, cache-dependency-path: go.sum).
  • ci.ymlgolangci-lint pinned to v1.64.8 instead of latest for reproducible, cache-friendly lint runs (matches the locally installed version).
  • release.yml — added an actions/cache step for ~/.cache/go-build and ~/go/pkg/mod before GoReleaser, which otherwise recompiles all 4 platform targets from scratch.
  • Makefilebuild/install targets gain -trimpath and -s -w ldflags via GO_BUILD_FLAGS/LDFLAGS variables, matching .goreleaser.yml for reproducible, cache-friendly local artifacts.

Testing

  • make build
  • make test
  • go vet ./...
  • pre-commit hook ✓

Nightshift-Task: build-optimize
Nightshift-Ref: https://github.com/marcus/nightshift

🤖 Generated with Claude Code

Align CI Go toolchain with go.mod, make module/build caching explicit,
pin golangci-lint, add a Go build cache to the release workflow, and
add reproducible build flags to the Makefile.

- ci.yml: use go-version-file: go.mod in test and lint jobs so the
  toolchain matches the module's go 1.24.0 requirement (the previous
  hardcoded 1.23 forced toolchain re-downloads and cache misses)
- ci.yml: enable explicit setup-go caching keyed on go.sum
- ci.yml: pin golangci-lint to v1.64.8 instead of latest for
  reproducible, cache-friendly lint runs
- release.yml: add actions/cache for ~/.cache/go-build and
  ~/go/pkg/mod before GoReleaser, which otherwise recompiles all 4
  platform targets from scratch
- Makefile: add -trimpath and -s -w ldflags to build/install targets
  via GO_BUILD_FLAGS/LDFLAGS variables, matching .goreleaser.yml

Nightshift-Task: build-optimize
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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