Skip to content

Commit a727932

Browse files
jamesarichclaude
andcommitted
ci(codecov): decouple Codecov flags from CI shard names
The codecov.yml flags (host-unit/android-instrumented) were dead config: uploads were tagged with the CI shard names (shard-core/shard-feature/ shard-app) instead, so the declared flags never received data. Worse, the shards are load-balanced by test-execution time, not by module boundary — shard-app mixes androidApp, desktopApp, and stray core/ feature modules — so shard-named flags conflated unrelated logical areas, which is the opposite of what Codecov flags are for. Flags now follow logical module groups (core/feature/app/desktop), matching component_management paths. Each shard job uploads per group with a path-scoped files glob, and disable_search prevents the uploader's workspace auto-discovery from re-attributing other groups' reports to the wrong flag when a glob matches nothing on that shard. Shards can now be rebalanced freely without touching flag attribution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d452746 commit a727932

2 files changed

Lines changed: 93 additions & 10 deletions

File tree

.github/workflows/reusable-check.yml

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,26 +310,101 @@ jobs:
310310
./gradlew ${{ matrix.shard.tasks }} $kover_tasks -Pci=true --continue \
311311
"-Dscan.value.CI shard=${{ matrix.shard.name }}"
312312
313-
- name: Upload test results to Codecov
313+
# Flags are tagged by logical module group (core/feature/app/desktop), matching
314+
# codecov.yml's flags/component_management — NOT by shard name. Shards are a CI
315+
# load-balancing detail; which shard happens to run a module must not change
316+
# which Codecov flag its coverage lands under.
317+
- name: Upload test results to Codecov (core)
314318
if: ${{ !cancelled() }}
315319
uses: codecov/codecov-action@v7
316320
with:
317321
token: ${{ secrets.CODECOV_TOKEN }}
318322
slug: meshtastic/Meshtastic-Android
319-
flags: ${{ matrix.shard.name }}
323+
flags: core
320324
fail_ci_if_error: false
325+
disable_search: true
321326
report_type: test_results
322-
files: "**/build/test-results/**/*.xml"
327+
files: "core/**/build/test-results/**/*.xml"
323328

324-
- name: Upload coverage to Codecov
329+
- name: Upload test results to Codecov (feature)
330+
if: ${{ !cancelled() }}
331+
uses: codecov/codecov-action@v7
332+
with:
333+
token: ${{ secrets.CODECOV_TOKEN }}
334+
slug: meshtastic/Meshtastic-Android
335+
flags: feature
336+
fail_ci_if_error: false
337+
disable_search: true
338+
report_type: test_results
339+
files: "feature/**/build/test-results/**/*.xml"
340+
341+
- name: Upload test results to Codecov (app)
342+
if: ${{ !cancelled() }}
343+
uses: codecov/codecov-action@v7
344+
with:
345+
token: ${{ secrets.CODECOV_TOKEN }}
346+
slug: meshtastic/Meshtastic-Android
347+
flags: app
348+
fail_ci_if_error: false
349+
disable_search: true
350+
report_type: test_results
351+
files: "androidApp/build/test-results/**/*.xml"
352+
353+
- name: Upload test results to Codecov (desktop)
354+
if: ${{ !cancelled() }}
355+
uses: codecov/codecov-action@v7
356+
with:
357+
token: ${{ secrets.CODECOV_TOKEN }}
358+
slug: meshtastic/Meshtastic-Android
359+
flags: desktop
360+
fail_ci_if_error: false
361+
disable_search: true
362+
report_type: test_results
363+
files: "desktopApp/build/test-results/**/*.xml"
364+
365+
- name: Upload coverage to Codecov (core)
366+
if: ${{ !cancelled() && inputs.run_coverage }}
367+
uses: codecov/codecov-action@v7
368+
with:
369+
token: ${{ secrets.CODECOV_TOKEN }}
370+
slug: meshtastic/Meshtastic-Android
371+
flags: core
372+
fail_ci_if_error: false
373+
disable_search: true
374+
files: "core/**/build/reports/kover/report*.xml"
375+
376+
- name: Upload coverage to Codecov (feature)
377+
if: ${{ !cancelled() && inputs.run_coverage }}
378+
uses: codecov/codecov-action@v7
379+
with:
380+
token: ${{ secrets.CODECOV_TOKEN }}
381+
slug: meshtastic/Meshtastic-Android
382+
flags: feature
383+
fail_ci_if_error: false
384+
disable_search: true
385+
files: "feature/**/build/reports/kover/report*.xml"
386+
387+
- name: Upload coverage to Codecov (app)
388+
if: ${{ !cancelled() && inputs.run_coverage }}
389+
uses: codecov/codecov-action@v7
390+
with:
391+
token: ${{ secrets.CODECOV_TOKEN }}
392+
slug: meshtastic/Meshtastic-Android
393+
flags: app
394+
fail_ci_if_error: false
395+
disable_search: true
396+
files: "androidApp/build/reports/kover/report*.xml"
397+
398+
- name: Upload coverage to Codecov (desktop)
325399
if: ${{ !cancelled() && inputs.run_coverage }}
326400
uses: codecov/codecov-action@v7
327401
with:
328402
token: ${{ secrets.CODECOV_TOKEN }}
329403
slug: meshtastic/Meshtastic-Android
330-
flags: ${{ matrix.shard.name }}
404+
flags: desktop
331405
fail_ci_if_error: false
332-
files: "**/build/reports/kover/report*.xml"
406+
disable_search: true
407+
files: "desktopApp/build/reports/kover/report*.xml"
333408

334409
- name: Upload shard reports
335410
if: ${{ always() && inputs.upload_artifacts }}

codecov.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,21 @@ comment:
2525
require_changes: false # Post a comment even if coverage doesn't change
2626

2727
flags:
28-
host-unit:
28+
core:
2929
paths:
30-
- .
30+
- core/**
3131
carryforward: true
32-
android-instrumented:
32+
feature:
3333
paths:
34-
- .
34+
- feature/**
35+
carryforward: true
36+
app:
37+
paths:
38+
- androidApp/**
39+
carryforward: true
40+
desktop:
41+
paths:
42+
- desktopApp/**
3543
carryforward: true
3644

3745
component_management:

0 commit comments

Comments
 (0)