Skip to content

Commit 361008f

Browse files
committed
Consolidate codecov upload
1 parent 8d341d7 commit 361008f

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

.github/workflows/tests.yaml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ jobs:
4141
name: frontend-coverage
4242
path: frontend/coverage/
4343
retention-days: 30
44-
- name: Upload coverage to Codecov
45-
uses: codecov/codecov-action@v4
46-
with:
47-
token: ${{ secrets.CODECOV_TOKEN }}
48-
files: ./frontend/coverage/lcov.info
49-
flags: frontend
50-
name: frontend-coverage
51-
fail_ci_if_error: false
5244

5345
test-backend:
5446
runs-on: ubuntu-latest
@@ -71,19 +63,11 @@ jobs:
7163
run: hatch run test-cov
7264
- name: Upload coverage reports
7365
uses: actions/upload-artifact@v4
74-
if: always()
66+
if: always() && matrix.python-version == '3.11'
7567
with:
76-
name: backend-coverage-py${{ matrix.python-version }}
68+
name: backend-coverage
7769
path: backend/coverage.xml
7870
retention-days: 30
79-
- name: Upload coverage to Codecov
80-
uses: codecov/codecov-action@v4
81-
with:
82-
token: ${{ secrets.CODECOV_TOKEN }}
83-
files: ./backend/coverage.xml
84-
flags: backend
85-
name: backend-coverage-py${{ matrix.python-version }}
86-
fail_ci_if_error: false
8771

8872
build-backend:
8973
runs-on: ubuntu-latest
@@ -102,6 +86,28 @@ jobs:
10286
dockerfiles: |
10387
./backend/docker/Dockerfile.${{ matrix.app }}
10488
89+
upload-coverage:
90+
runs-on: ubuntu-latest
91+
needs: [test-backend, lint-test-frontend]
92+
if: always()
93+
steps:
94+
- uses: actions/checkout@v4
95+
- name: Download all coverage artifacts
96+
uses: actions/download-artifact@v4
97+
with:
98+
path: coverage-reports
99+
pattern: '*-coverage*'
100+
- name: Display structure of downloaded files
101+
run: ls -R coverage-reports
102+
- name: Upload coverage to Codecov
103+
uses: codecov/codecov-action@v5
104+
with:
105+
token: ${{ secrets.CODECOV_TOKEN }}
106+
directory: ./coverage-reports
107+
name: codecov-umbrella
108+
fail_ci_if_error: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
109+
verbose: true
110+
105111
build-frontend:
106112
runs-on: ubuntu-latest
107113
needs: lint-test-frontend

codecov.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,27 @@ flags:
2626
paths:
2727
- backend/ibutsu_server/
2828
carryforward: true
29-
after_n_builds: 3 # Wait for all 3 Python versions
3029
target: 85%
3130
threshold: 0.5%
3231

3332
util:
3433
paths:
3534
- backend/ibutsu_server/util/
3635
carryforward: true
37-
after_n_builds: 3
3836
target: 85%
3937
threshold: 0.5%
4038

4139
widgets:
4240
paths:
4341
- backend/ibutsu_server/widgets/
4442
carryforward: true
45-
after_n_builds: 3
4643
target: 85%
4744
threshold: 0.5%
4845

4946
tasks:
5047
paths:
5148
- backend/ibutsu_server/tasks/
5249
carryforward: true
53-
after_n_builds: 3
5450
target: 85%
5551
threshold: 0.5%
5652

0 commit comments

Comments
 (0)