@@ -8,14 +8,11 @@ name: Codecov Notify
88# the triggering SHA. Workflows that skipped due to path filters don't block
99# the notify step.
1010#
11- # This workflow also merges the three per-suite frontend lcov reports
12- # (`frontend-unit-lcov`, `frontend-ct-lcov`, `frontend-e2e-lcov`, each
13- # published as a GitHub Actions artifact by its producing job) into a
14- # single lcov and uploads it to Codecov under the `frontend` flag. That
15- # gives one authoritative Frontend coverage number — the README badge
16- # reads it, and PR comments show the merged total alongside the per-suite
17- # flags. The three individual flag uploads still happen in their own
18- # workflows, so drill-in by suite continues to work.
11+ # The merged `frontend` flag that the README badge reads is produced
12+ # server-side: each per-suite frontend upload (`frontend-unit`,
13+ # `frontend-component`, `frontend-e2e`) is tagged with `frontend` as an
14+ # additional flag in its own workflow, so Codecov aggregates the union
15+ # of all three without any cross-workflow lcov merging here.
1916
2017on :
2118 workflow_run :
6057 );
6158
6259 let allDone = true;
63- const runIds = {};
6460 for (const name of expected) {
6561 const matching = runs
6662 .filter((r) => r.name === name)
@@ -77,102 +73,13 @@ jobs:
7773 core.info(
7874 `${name}: status=${latest.status} conclusion=${latest.conclusion} id=${latest.id}`
7975 );
80- runIds[name] = latest.id;
8176 if (latest.status !== "completed") {
8277 allDone = false;
8378 }
8479 }
8580
8681 core.setOutput("all_done", allDone ? "true" : "false");
8782 core.setOutput("sha", sha);
88- core.setOutput(
89- "frontend_ci_run_id",
90- runIds["Frontend CI"] || ""
91- );
92- core.setOutput(
93- "frontend_e2e_run_id",
94- runIds["Frontend E2E Integration"] || ""
95- );
96-
97- # ────────────────────────────────────────────────────────────────
98- # Download per-suite lcov artifacts from each producing workflow.
99- #
100- # Each download is guarded by the producing workflow's run id (empty
101- # string when that workflow was path-filtered for this SHA), and
102- # `continue-on-error: true` tolerates a completed run that did not
103- # publish the artifact (for example, when the suite failed before
104- # the upload step ran).
105- # ────────────────────────────────────────────────────────────────
106- - name : Download unit lcov artifact
107- if : steps.check.outputs.all_done == 'true' && steps.check.outputs.frontend_ci_run_id != ''
108- continue-on-error : true
109- uses : actions/download-artifact@v7
110- with :
111- github-token : ${{ secrets.GITHUB_TOKEN }}
112- run-id : ${{ steps.check.outputs.frontend_ci_run_id }}
113- name : frontend-unit-lcov
114- path : coverage/unit
115-
116- - name : Download component lcov artifact
117- if : steps.check.outputs.all_done == 'true' && steps.check.outputs.frontend_ci_run_id != ''
118- continue-on-error : true
119- uses : actions/download-artifact@v7
120- with :
121- github-token : ${{ secrets.GITHUB_TOKEN }}
122- run-id : ${{ steps.check.outputs.frontend_ci_run_id }}
123- name : frontend-ct-lcov
124- path : coverage/ct
125-
126- - name : Download e2e lcov artifact
127- if : steps.check.outputs.all_done == 'true' && steps.check.outputs.frontend_e2e_run_id != ''
128- continue-on-error : true
129- uses : actions/download-artifact@v7
130- with :
131- github-token : ${{ secrets.GITHUB_TOKEN }}
132- run-id : ${{ steps.check.outputs.frontend_e2e_run_id }}
133- name : frontend-e2e-lcov
134- path : coverage/e2e
135-
136- - name : Check for downloaded lcov files
137- id : lcov
138- if : steps.check.outputs.all_done == 'true'
139- run : |
140- shopt -s nullglob
141- files=(coverage/*/lcov.info)
142- if [ ${#files[@]} -eq 0 ]; then
143- echo "No lcov artifacts retrieved; skipping merged frontend upload."
144- echo "has_lcov=false" >> "$GITHUB_OUTPUT"
145- else
146- echo "Found ${#files[@]} lcov file(s):"
147- printf ' - %s\n' "${files[@]}"
148- echo "has_lcov=true" >> "$GITHUB_OUTPUT"
149- fi
150-
151- - name : Setup Node.js
152- if : steps.lcov.outputs.has_lcov == 'true'
153- uses : actions/setup-node@v6
154- with :
155- node-version : " 20"
156-
157- - name : Merge frontend lcov reports
158- if : steps.lcov.outputs.has_lcov == 'true'
159- run : |
160- mkdir -p coverage/merged
161- npx --yes lcov-result-merger@5 'coverage/*/lcov.info' coverage/merged/lcov.info
162- echo "Merged lcov source-file count:"
163- grep -c "^SF:" coverage/merged/lcov.info || true
164-
165- - name : Upload merged frontend coverage to Codecov
166- if : steps.lcov.outputs.has_lcov == 'true'
167- uses : codecov/codecov-action@v6
168- with :
169- token : ${{ secrets.CODECOV_TOKEN }}
170- files : coverage/merged/lcov.info
171- flags : frontend
172- name : frontend-merged-coverage
173- fail_ci_if_error : false
174- disable_search : true
175- override_commit : ${{ steps.check.outputs.sha }}
17683
17784 - name : Send notifications to Codecov
17885 if : steps.check.outputs.all_done == 'true'
0 commit comments