Skip to content

CI: Publish the repository's code coverage results #139

Description

@tablackburn

Once the repository's own Pester task measures code coverage (JaCoCo output under tests/out/), CI should surface it — today the shared workflow only uploads and publishes testResults.xml.

Why this is a separate issue

This repository's test.yml delegates to the psake org's shared workflow (psake/.github/.github/workflows/ModuleCI.yml@main), whose artifact/publish steps are fixed. Surfacing coverage therefore requires a change in the psake/.github repository, not here. Options, roughly in ascending ambition:

  1. Extend the shared workflow's artifact upload to include tests/out/coverage.xml when present
  2. Add a coverage PR comment/check (for example irongut/CodeCoverageSummary or the JaCoCo report action) gated on the file existing, so modules without coverage output are unaffected
  3. Wire up a coverage service (Codecov and similar) with badges

Interim state

The repository prints a coverage summary line in the Pester task output, so the number is visible in every CI log even before the shared workflow learns to publish the artifact.

Caveat worth documenting wherever this lands

Coverage instruments the current session only. Tests that exercise code in child processes (the build.tests.ps1 child builds and the Test-PSBuildPester subprocess matrix from #102) do not contribute to the measured number, so the metric understates true coverage — useful as a trend line, not as an absolute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions