diff --git a/.github/codecov.yml b/.github/codecov.yml index 3c8819a15fe..e93736b5c2c 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,6 +1,9 @@ -# Flags partition coverage by test suite. carryforward ensures that if GPU tests are skipped -# on a PR (no relevant file changes), their coverage from the last nightly run is reused so -# the comparison is not penalized for the missing upload. +# Flags partition coverage by test suite, and the example lanes carry one flag each +# (examples-) since they are gated independently. carryforward reuses the last run's +# coverage for any flag with no upload on this commit, so a PR that skips a suite or a single +# example lane is not penalized for the missing upload. A flag shared across independently +# gated jobs would defeat this: the flag would be present but partial, and carryforward only +# applies when a flag is absent. flag_management: default_rules: carryforward: true diff --git a/.github/workflows/_example_tests_runner.yml b/.github/workflows/_example_tests_runner.yml index c3a9ffa1274..4a77131435f 100644 --- a/.github/workflows/_example_tests_runner.yml +++ b/.github/workflows/_example_tests_runner.yml @@ -92,6 +92,9 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - flags: examples + # One flag per example, not a shared `examples`: carryforward only applies to a flag + # with no upload, so a shared flag would replace every lane's coverage with the subset + # that ran once lanes are gated independently. + flags: examples-${{ inputs.example }} fail_ci_if_error: false # test may be skipped if relevant file changes are not detected verbose: true