diff --git a/.github/workflows/codecov-upload.yml b/.github/workflows/codecov-upload.yml index 57bf7b09..d16b2192 100644 --- a/.github/workflows/codecov-upload.yml +++ b/.github/workflows/codecov-upload.yml @@ -26,19 +26,19 @@ jobs: go-version: '1.25.5' cache-dependency-path: backend/go.sum - - name: Run Go tests - working-directory: backend + - name: Run Go tests with coverage + working-directory: ${{ github.workspace }} env: CGO_ENABLED: 1 run: | - go test -race -v -coverprofile=coverage.out ./... 2>&1 | tee test-output.txt + bash scripts/go-test-coverage.sh 2>&1 | tee backend/test-output.txt exit ${PIPESTATUS[0]} - name: Upload backend coverage to Codecov uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./backend/coverage.out + files: ./backend/coverage.txt flags: backend fail_ci_if_error: true diff --git a/scripts/go-test-coverage.sh b/scripts/go-test-coverage.sh index 100a1470..07f430ca 100755 --- a/scripts/go-test-coverage.sh +++ b/scripts/go-test-coverage.sh @@ -17,6 +17,7 @@ EXCLUDE_PACKAGES=( "github.com/Wikid82/charon/backend/cmd/seed" "github.com/Wikid82/charon/backend/internal/logger" "github.com/Wikid82/charon/backend/internal/metrics" + "github.com/Wikid82/charon/backend/internal/trace" ) # Try to run tests to produce coverage file; some toolchains may return a non-zero