From 7253c912ca0eeef6693bb2c0c336f49bd07014af Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Thu, 5 Mar 2026 17:39:38 -0500 Subject: [PATCH] ci: add test pipeline with codecov, staticcheck, and race detection (#10) * ci: add test pipeline with codecov, staticcheck, and race detection - Build/test matrix: Go 1.25 + 1.26 - Race detection enabled for all tests - Coverage uploaded to Codecov (latest Go only) - staticcheck lint step - Go module caching via setup-go * ci: drop Go 1.25 from matrix (go.mod requires 1.26) --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e5ed274 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + test: + name: Test (Go ${{ matrix.go-version }}) + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ["1.26"] + steps: + - uses: actions/checkout@v4 + + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + cache: true + + - name: Run tests with race detection and coverage + run: go test -race -coverprofile=coverage.out -covermode=atomic ./... + + - name: Upload coverage to Codecov + if: matrix.go-version == '1.26' + uses: codecov/codecov-action@v5 + with: + files: coverage.out + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.26" + cache: true + + - name: Run staticcheck + uses: dominikh/staticcheck-action@v1 + with: + version: latest + install-go: false