Skip to content

Commit 896d146

Browse files
authored
chore: Upload nightly and frontend coverage to Codecov (#1658)
- Nightly: add -coverprofile to full test suite (no -short flag), filter proto files, upload with 'integration' flag - Frontend: upload Vitest coverage-final.json with 'frontend' flag - Codecov config: add integration and frontend flags, stop ignoring all of frontend/ (only ignore generated api/gen/) Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
1 parent 388952c commit 896d146

3 files changed

Lines changed: 42 additions & 3 deletions

File tree

.github/workflows/frontend.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,22 @@ jobs:
5656
if: always()
5757
uses: actions/upload-artifact@v7
5858
with:
59-
name: coverage-report
59+
name: frontend-coverage-report
6060
path: frontend/coverage/
6161
retention-days: 7
6262
if-no-files-found: ignore
6363

64+
- name: Upload coverage to Codecov
65+
if: always()
66+
uses: codecov/codecov-action@v5
67+
with:
68+
files: ./frontend/coverage/coverage-final.json
69+
flags: frontend
70+
name: frontend-vitest
71+
fail_ci_if_error: false
72+
env:
73+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
74+
6475
- name: Check 80% line coverage threshold
6576
run: |
6677
node -e "

.github/workflows/nightly.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,30 @@ jobs:
125125
run: |
126126
# Run WITHOUT -short flag to include all timing-sensitive tests
127127
# Regular CI runs with -short, but nightly runs the full suite
128+
mkdir -p coverage
128129
echo "Running full test suite including timing-sensitive tests..."
129130
gotestsum --format testdox \
130131
--junitfile test-results.xml \
131132
--jsonfile test-results.json \
132-
-- -race -timeout 15m ./...
133+
-- -race -coverprofile=coverage/coverage.out -covermode=atomic -timeout 15m ./...
134+
135+
- name: Filter generated files from coverage
136+
if: always()
137+
run: |
138+
if [ -f coverage/coverage.out ]; then
139+
grep -v -E '\.pb\.go|\.pb\.validate\.go|_grpc\.pb\.go' coverage/coverage.out > coverage/coverage-filtered.out || true
140+
fi
141+
142+
- name: Upload coverage to Codecov
143+
if: always()
144+
uses: codecov/codecov-action@v5
145+
with:
146+
files: ./coverage/coverage-filtered.out
147+
flags: integration
148+
name: nightly-full-suite
149+
fail_ci_if_error: false
150+
env:
151+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
133152

134153
- name: Upload test results
135154
uses: actions/upload-artifact@v7

codecov.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ignore:
1414
- "**/*_grpc.pb.go"
1515
- "**/mocks/**"
1616
- "utilities/**"
17-
- "frontend/**"
17+
- "frontend/src/api/gen/**"
1818

1919
comment:
2020
layout: "condensed_header, condensed_files, condensed_footer"
@@ -27,3 +27,12 @@ flags:
2727
- "services/"
2828
- "shared/"
2929
carryforward: true
30+
integration:
31+
paths:
32+
- "services/"
33+
- "shared/"
34+
carryforward: true
35+
frontend:
36+
paths:
37+
- "frontend/src/"
38+
carryforward: true

0 commit comments

Comments
 (0)