Skip to content

Commit 906eba2

Browse files
authored
ci(coverage): run coverage without ci-optimization on release and schedule (#13579)
1 parent 528d705 commit 906eba2

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

.github/workflows/build-and-test.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
branches:
1212
- "**"
1313
workflow_dispatch:
14+
schedule:
15+
- cron: "0 0 * * *" # Run at midnight UTC every day
1416
release:
1517
types: [published]
1618

@@ -134,7 +136,19 @@ jobs:
134136
- name: Ensure codegen is updated
135137
uses: ./.github/actions/ensure-codegen-updated
136138
- name: Upload backend coverage to Codecov
137-
if: ${{ matrix.command == 'except_metadata_ingestion' && needs.setup.outputs.backend_change == 'true' }}
139+
if: ${{ (matrix.command == 'except_metadata_ingestion' && needs.setup.outputs.backend_change == 'true' && github.event_name != 'release') }}
140+
uses: codecov/codecov-action@v5
141+
with:
142+
token: ${{ secrets.CODECOV_TOKEN }}
143+
files: ${{ env.BACKEND_FILES }}
144+
disable_search: true
145+
#handle_no_reports_found: true
146+
fail_ci_if_error: false
147+
flags: backend
148+
name: ${{ matrix.command }}
149+
verbose: true
150+
- name: Upload backend coverage to Codecov on release
151+
if: ${{ (matrix.command == 'except_metadata_ingestion' && github.event_name == 'release' ) }}
138152
uses: codecov/codecov-action@v5
139153
with:
140154
token: ${{ secrets.CODECOV_TOKEN }}
@@ -146,8 +160,22 @@ jobs:
146160
name: ${{ matrix.command }}
147161
verbose: true
148162
override_branch: ${{ github.head_ref || github.ref_name }}
163+
149164
- name: Upload frontend coverage to Codecov
150-
if: ${{ matrix.command == 'frontend' && needs.setup.outputs.frontend_change == 'true' }}
165+
if: ${{ (matrix.command == 'frontend' && needs.setup.outputs.frontend_change == 'true' && github.event_name != 'release') }}
166+
uses: codecov/codecov-action@v5
167+
with:
168+
token: ${{ secrets.CODECOV_TOKEN }}
169+
files: ${{ env.FRONTEND_FILES }}
170+
disable_search: true
171+
#handle_no_reports_found: true
172+
fail_ci_if_error: false
173+
flags: frontend
174+
name: ${{ matrix.command }}
175+
verbose: true
176+
177+
- name: Upload frontend coverage to Codecov on Release
178+
if: ${{ (matrix.command == 'frontend' && github.event_name == 'release') }}
151179
uses: codecov/codecov-action@v5
152180
with:
153181
token: ${{ secrets.CODECOV_TOKEN }}
@@ -160,7 +188,12 @@ jobs:
160188
verbose: true
161189
override_branch: ${{ github.head_ref || github.ref_name }}
162190
- name: Upload test results to Codecov
163-
if: ${{ !cancelled() }}
191+
if: ${{ !cancelled() && github.event_name != 'release' }}
192+
uses: codecov/test-results-action@v1
193+
with:
194+
token: ${{ secrets.CODECOV_TOKEN }}
195+
- name: Upload test results to Codecov on release
196+
if: ${{ !cancelled() && github.event_name == 'release' }}
164197
uses: codecov/test-results-action@v1
165198
with:
166199
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)