Skip to content

Add GitHub Actions CI workflow for Go test matrix, linting, and Codecov - #189

Merged
anacrolix merged 3 commits into
masterfrom
copilot/add-github-actions-workflow
Aug 13, 2026
Merged

Add GitHub Actions CI workflow for Go test matrix, linting, and Codecov#189
anacrolix merged 3 commits into
masterfrom
copilot/add-github-actions-workflow

Conversation

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This adds the repository’s missing test automation in GitHub Actions. CI now runs on pushes to master and on pull requests, covering the Go versions in scope, race-enabled tests, coverage reporting, linting, and Codecov upload.

  • Workflow coverage

    • Adds .github/workflows/ci.yml
    • Triggers on:
      • push to master
      • pull_request
  • Go test matrix

    • Runs tests on Go 1.25 and 1.24
    • Uses race detection and coverage output in the test job
  • Coverage upload

    • Uploads coverage.out to Codecov
    • Tags uploads by Go version to keep matrix results distinct
  • Linting

    • Adds a dedicated golangci-lint job
    • Uses the Go version from go.mod for lint consistency
  • Coverage generation detail

    • Limits coverage profile generation to packages that actually contain tests, avoiding coverage-tool failures from packages without test files
strategy:
  matrix:
    go-version: ['1.25', '1.24']

run: |
  mapfile -t packages < <(go list -f '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./... | sed '/^$/d')
  go test -race -covermode=atomic -coverprofile=coverage.out "${packages[@]}"

Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions workflow to run tests in CI Add GitHub Actions CI workflow for Go test matrix, linting, and Codecov Aug 12, 2026
Copilot AI requested a review from anacrolix August 12, 2026 01:20
@anacrolix

Copy link
Copy Markdown
Owner

@copilot check go1.25 is actually required. set go version in go.mod to minimum viable. run CI on go stable and oldstable versions (if minimum version allows this at present). fix lints or modify rules as appropriate

Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot check go1.25 is actually required. set go version in go.mod to minimum viable. run CI on go stable and oldstable versions (if minimum version allows this at present). fix lints or modify rule...

Addressed in 348475f. The repo now targets Go 1.24.0 after downgrading only golang.org/x/net to v0.50.0 and golang.org/x/sys to v0.41.0, while CI still tests on 1.25 and 1.24. I also changed the lint job to build golangci-lint under the runner toolchain and run a focused passing ruleset (govet, ineffassign, misspell).

@anacrolix

Copy link
Copy Markdown
Owner

@copilot why do you make PRs as drafts? Who do you expect to mark them as ready for review?

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot why do you make PRs as drafts? Who do you expect to mark them as ready for review?

I don’t expect someone else to babysit that. The draft state wasn’t intentional here; unless I’m explicitly waiting on more work, the PR should be ready for review. I don’t have a tool in this environment to flip the PR state, but I’ll treat draft as the exception rather than the default.

@anacrolix
anacrolix marked this pull request as ready for review August 13, 2026 05:52
@anacrolix
anacrolix merged commit f17f131 into master Aug 13, 2026
5 checks passed
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