From 2b39350caa24b74d2a5f70c33abb02a4f11377c5 Mon Sep 17 00:00:00 2001 From: b0r1ssh <295612221+b0r1ssh@users.noreply.github.com> Date: Tue, 8 Sep 2026 21:06:03 +0200 Subject: [PATCH] Add codecov --- .github/workflows/go-test.yml | 10 +++++++++- .github/workflows/publish-on-main.yml | 9 --------- code_test.go | 2 ++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 1ee2cdd..69ea3d5 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -35,4 +35,12 @@ jobs: run: go mod download - name: Run tests - run: go test ./... + run: go test -race -covermode=atomic -coverprofile=coverage.out ./... + + - name: Upload coverage to Codecov + if: success() && matrix.go-version == '1.25' + uses: codecov/codecov-action@v7 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.out + fail_ci_if_error: true diff --git a/.github/workflows/publish-on-main.yml b/.github/workflows/publish-on-main.yml index 3bdd73d..ad721ff 100644 --- a/.github/workflows/publish-on-main.yml +++ b/.github/workflows/publish-on-main.yml @@ -24,15 +24,6 @@ jobs: with: fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version: '1.27' - cache: true - - - name: Run tests - run: go test ./... - - name: Determine next version id: version shell: bash diff --git a/code_test.go b/code_test.go index aedc49c..20f323f 100644 --- a/code_test.go +++ b/code_test.go @@ -823,6 +823,8 @@ func TestNameRoundtrip(t *testing.T) { // TestNameUnknown verifies Name() returns empty string for unknown codes. func TestNameUnknown(t *testing.T) { + t.Parallel() + unknown := []string{"", "99999", "ZZZZZ", "00001"} for _, code := range unknown { if got := pgcode.Name(code); got != "" {