feat: Update Go test workflow to use coverage script and include additional package in coverage exclusion

This commit is contained in:
GitHub Actions
2025-12-08 05:59:35 +00:00
parent 63cebf07ab
commit 05418fe638
2 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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