From c1d9c974f642ec058a36b5ea55b18f8f01989187 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 26 Nov 2026 15:52:46 +0100 Subject: [PATCH 01/28] feat(coverage): support native GitHub Code Quality reports --- .github/workflows/__shared-ci.yml | 1 + ...__test-workflow-continuous-integration.yml | 13 +++++++ .github/workflows/continuous-integration.yml | 28 ++++++++++++--- actions/test/action.test.cjs | 2 +- actions/test/action.yml | 34 +++++++++++++++++-- tests/config.test.cjs | 21 ++++++++++++ 6 files changed, 90 insertions(+), 9 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index abe94d7..61c44ac 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -26,6 +26,7 @@ jobs: uses: $/.github/workflows/__test-workflow-continuous-integration.yml permissions: contents: read + pull-requests: write id-token: write test-action-setup-python: uses: $/.github/workflows/__test-action-setup-python.yml diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index ae8c490..0a9e659 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -26,6 +26,7 @@ jobs: id-token: write with: working-directory: tests/python-project + test: '{"coverage":"github-code-quality","report-group":"fixture"}' python-versions: '["3.13", "3.15"]' dependency-review: false package: '{"tests": "python -I -c \"from ci_python_fixture import add; assert add(2, 3) == 5\""}' @@ -39,3 +40,15 @@ jobs: working-directory: must-not-exist lint: exit 99 test: exit 99 + + collect-native-coverage: + name: Verify coverage from the primary runtime + needs: fixture + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@71ce8b3ff53d6673617b19fa01d6637c916d4948 # coverage support (PR #683, unreleased) + permissions: + contents: read + pull-requests: write + with: + comment: false + job-results: ${{ toJSON(needs) }} + coverage-reports: '[{"job":"fixture","label":"tests/python-project"}]' diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 871cc78..d16223b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -97,6 +97,18 @@ # for standalone action usage. Pin the workflow to a reviewed commit SHA in production. --- +# +# ## Native GitHub coverage +# +# Select `test: '{"coverage":"github-code-quality","report-group":"backend"}'`. +# This tests the PR head commit; existing destinations keep their usual merge-ref +# checkout. Keep a separate merge-result test invocation when your policy requires it. +# Only the primary runtime publishes coverage. Optionally set test.coverage-reports +# to an array of {file, language, label} for multiple Cobertura components. +# Call the common ci-reports workflow with every expected job/label, then its +# publish-coverage workflow. Only publication needs code-quality: write. +# See [native coverage collection](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.md#native-github-coverage). + name: Python Continuous Integration "on": workflow_call: @@ -122,7 +134,7 @@ name: Python Continuous Integration type: string default: "true" test: - description: true for default tests, a trusted Bash command, or a JSON object with command, coverage (`github`, `codecov` or empty). false, null or empty disables tests. Coverage publication runs only on the last version; the command controls collection. + description: "true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports, report-group). false, null or empty disables tests. Only the primary runtime publishes coverage." type: string default: "true" audit: @@ -181,13 +193,14 @@ jobs: if (unknown.length) throw new Error('Unknown ' + name + ' options: ' + unknown.join(', ')); config = {...defaults, ...config}; for (const [key, value] of Object.entries(config)) { - if (typeof value !== typeof defaults[key]) throw new Error(name + '.' + key + ' has the wrong type.'); + if (Array.isArray(defaults[key]) ? !Array.isArray(value) : typeof value !== typeof defaults[key]) throw new Error(name + '.' + key + ' has the wrong type.'); } return config; } const lint = options('lint', process.env.LINT, {command: ''}); - const test = options('test', process.env.TEST, {"command": "uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml", "coverage": "github"}); - if (test && !['', 'github', 'codecov'].includes(test.coverage)) throw new Error('test.coverage must be github, codecov or empty.'); + const test = options('test', process.env.TEST, {"command": "uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml", "coverage": "github", "coverage-reports": [], "report-group": ""}); + if (test && test['report-group'] && !/^[\w-]+$/.test(test['report-group'])) throw new Error('test.report-group must be a job ID.'); + if (test && !['', 'github', 'github-code-quality', 'codecov'].includes(test.coverage)) throw new Error('test.coverage must be github, github-code-quality, codecov or empty.'); let pkg; try { pkg = JSON.parse(process.env.PACKAGE.trim() || 'false'); } catch { throw new Error('package must be true, false or an object with tests.'); } @@ -241,7 +254,10 @@ jobs: contents: read id-token: write steps: - - *checkout + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ fromJSON(needs.configuration.outputs.test).coverage == 'github-code-quality' && github.event.pull_request.head.sha || github.sha }} + persist-credentials: false - uses: $/actions/setup-python with: working-directory: ${{ inputs.working-directory }} @@ -251,6 +267,8 @@ jobs: with: working-directory: ${{ inputs.working-directory }} command: ${{ fromJSON(needs.configuration.outputs.test).command }} + report-group: ${{ fromJSON(needs.configuration.outputs.test).report-group }} + coverage-reports: ${{ fromJSON(needs.configuration.outputs.test).coverage-reports[0] && toJSON(fromJSON(needs.configuration.outputs.test).coverage-reports) || '' }} coverage: ${{ matrix.version == needs.configuration.outputs.primary-version && fromJSON(needs.configuration.outputs.test).coverage || '' }} strategy: fail-fast: false diff --git a/actions/test/action.test.cjs b/actions/test/action.test.cjs index 25ba88b..b7b512b 100644 --- a/actions/test/action.test.cjs +++ b/actions/test/action.test.cjs @@ -36,7 +36,7 @@ test("test configuration rejects unsupported coverage destinations", (t) => { ); assert.equal( runActionStep(actionFile, "validate", directory, { - COVERAGE: "", + COVERAGE: "github-code-quality", RACE: "true", }).status, 0, diff --git a/actions/test/action.yml b/actions/test/action.yml index 2cc92d1..fcc48aa 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -27,6 +27,15 @@ description: | See the [continuous integration workflow](../../.github/workflows/continuous-integration.md#reports-and-permissions) for consolidated reporting and permissions. + + Native `coverage: github-code-quality` prepares Cobertura artifacts for the common + [CI reports workflow](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.md) + and its opt-in publication workflow. Set `report-group` to the outer calling job + and list every expected component in the collector. The default label is the + repository-relative working directory, or `root`. Multiple reports need explicit + stable labels. Reports must measure the PR head commit, not the PR merge commit. + Keep merge-result validation separately when required. No upload permission is + needed in this test action; only the publication job needs `code-quality: write`. author: hoverkraft branding: icon: package @@ -38,13 +47,23 @@ inputs: command: description: Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. default: uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml + coverage-reports: + description: | + Native GitHub coverage reports as a JSON array of file, language and optional label. + Empty uses cobertura.xml; multiple reports require explicit unique labels. + Every file must be Cobertura XML produced by the test command. Paths are relative + to working-directory. Example: [{"file":"coverage.xml","language":"Python","label":"backend"}]. + default: "" coverage: - description: "Publication only: `github`, `codecov`, or empty. Collection is controlled by command." + description: "Publication only: `github`, `github-code-quality`, `codecov`, or empty. Collection is controlled by command." default: github report-group: description: Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. default: "" outputs: + native-coverage-artifact-id: + description: Cobertura artifact for native GitHub publication, empty unless github-code-quality is selected. + value: ${{ steps.native-coverage.outputs.artifact-id }} report-artifact-id: description: Native report artifact ID. Empty when no reports were produced. value: ${{ steps.report-artifact.outputs.artifact-id }} @@ -60,7 +79,7 @@ runs: env: COVERAGE: ${{ inputs.coverage }} run: | - case "$COVERAGE" in github|codecov|'') ;; *) echo 'coverage must be github, codecov or empty.' >&2; exit 1 ;; esac + case "$COVERAGE" in github|github-code-quality|codecov|'') ;; *) echo 'coverage must be github, github-code-quality, codecov or empty.' >&2; exit 1 ;; esac - id: run shell: bash working-directory: ${{ steps.directory.outputs.absolute-path }} @@ -80,7 +99,7 @@ runs: uses: $/.github/actions/parse-ci-reports with: directory: ${{ steps.directory.outputs.absolute-path }} - report-paths: ${{ inputs.coverage == 'github' && 'auto:test,auto:coverage' || 'auto:test' }} + report-paths: ${{ (inputs.coverage == 'github' || inputs.coverage == 'github-code-quality') && 'auto:test,auto:coverage' || 'auto:test' }} report-name: Python test results group: ${{ inputs.report-group || github.job }} - name: Upload coverage to Codecov @@ -90,3 +109,12 @@ runs: working-directory: ${{ steps.directory.outputs.absolute-path }} files: cobertura.xml fail-ci-if-error: "true" + + - name: Prepare native GitHub coverage + id: native-coverage + if: ${{ !cancelled() && steps.run.outcome != 'skipped' && inputs.coverage == 'github-code-quality' }} + uses: hoverkraft-tech/ci-github-common/actions/quality/coverage-reports@71ce8b3ff53d6673617b19fa01d6637c916d4948 # coverage support (PR #683, unreleased) + with: + working-directory: ${{ steps.directory.outputs.absolute-path }} + report-group: ${{ inputs.report-group || github.job }} + reports: ${{ inputs.coverage-reports || '[{"file":"cobertura.xml","language":"Python"}]' }} diff --git a/tests/config.test.cjs b/tests/config.test.cjs index e2679f6..0cc9117 100644 --- a/tests/config.test.cjs +++ b/tests/config.test.cjs @@ -113,3 +113,24 @@ test("distribution checks are opt-in and validate consumer commands", async () = await assert.rejects(() => parse({ PACKAGE: value })); } }); + +test("preserves native coverage configuration and rejects ambiguous input types", async () => { + const options = { + coverage: "github-code-quality", + "report-group": "backend", + "coverage-reports": [ + { file: "custom.xml", language: "Python", label: "backend" }, + ], + }; + const actual = JSON.parse( + (await parse({ TEST: JSON.stringify(options) })).test, + ); + for (const [key, value] of Object.entries(options)) + assert.deepEqual(actual[key], value); + for (const invalid of [ + { "coverage-reports": {} }, + { "report-group": "bad/group" }, + ]) { + await assert.rejects(() => parse({ TEST: JSON.stringify(invalid) })); + } +}); From 25b7ef650c11d6aec76bc15704cfa6d5879aabf3 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 26 Nov 2026 15:57:15 +0100 Subject: [PATCH 02/28] docs(coverage): regenerate action and workflow references --- .github/workflows/continuous-integration.md | 28 +++++++++--------- actions/test/README.md | 32 +++++++++++++++++---- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/continuous-integration.md b/.github/workflows/continuous-integration.md index 2f507d6..6f49ba2 100644 --- a/.github/workflows/continuous-integration.md +++ b/.github/workflows/continuous-integration.md @@ -149,7 +149,7 @@ on: permissions: {} jobs: continuous-integration: - uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@244c9508c64e31d1a87327cc9ed07a13c235c454 # main + uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 permissions: contents: read id-token: write @@ -173,7 +173,7 @@ jobs: # Default: `true` lint: "true" - # true for default tests, a trusted Bash command, or a JSON object with command, coverage (`github`, `codecov` or empty). false, null or empty disables tests. Coverage publication runs only on the last version; the command controls collection. + # true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports, report-group). false, null or empty disables tests. Only the primary runtime publishes coverage. # Default: `true` test: "true" @@ -202,18 +202,18 @@ jobs: ### Workflow Call Inputs -| **Input** | **Description** | **Required** | **Type** | **Default** | -| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | ------------------- | -| **`runs-on`** | JSON array of Linux runner labels for all jobs. | **false** | **string** | `["ubuntu-latest"]` | -| **`checks`** | Enable all checks, including distribution checks. | **false** | **boolean** | `true` | -| **`working-directory`** | One project directory inside the checkout. Use a caller matrix for multiple projects. | **false** | **string** | `.` | -| **`python-versions`** | JSON array of Python versions. The last entry runs lint, audit and package checks and publishes coverage. Empty runs project detection once. An empty entry uses the project version. | **false** | **string** | - | -| **`lint`** | true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. | **false** | **string** | `true` | -| **`test`** | true for default tests, a trusted Bash command, or a JSON object with command, coverage (`github`, `codecov` or empty). false, null or empty disables tests. Coverage publication runs only on the last version; the command controls collection. | **false** | **string** | `true` | -| **`audit`** | Check production dependencies for known vulnerabilities. | **false** | **boolean** | `true` | -| **`dependency-review`** | Review dependency changes on pull requests. Requires GitHub dependency review availability. | **false** | **boolean** | `true` | -| **`package`** | false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. Does not publish packages. | **false** | **string** | `false` | -| **`uv-version`** | Pinned uv release. | **false** | **string** | `0.13.9` | +| **Input** | **Description** | **Required** | **Type** | **Default** | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | ------------------- | +| **`runs-on`** | JSON array of Linux runner labels for all jobs. | **false** | **string** | `["ubuntu-latest"]` | +| **`checks`** | Enable all checks, including distribution checks. | **false** | **boolean** | `true` | +| **`working-directory`** | One project directory inside the checkout. Use a caller matrix for multiple projects. | **false** | **string** | `.` | +| **`python-versions`** | JSON array of Python versions. The last entry runs lint, audit and package checks and publishes coverage. Empty runs project detection once. An empty entry uses the project version. | **false** | **string** | - | +| **`lint`** | true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. | **false** | **string** | `true` | +| **`test`** | true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports, report-group). false, null or empty disables tests. Only the primary runtime publishes coverage. | **false** | **string** | `true` | +| **`audit`** | Check production dependencies for known vulnerabilities. | **false** | **boolean** | `true` | +| **`dependency-review`** | Review dependency changes on pull requests. Requires GitHub dependency review availability. | **false** | **boolean** | `true` | +| **`package`** | false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. Does not publish packages. | **false** | **string** | `false` | +| **`uv-version`** | Pinned uv release. | **false** | **string** | `0.13.9` | diff --git a/actions/test/README.md b/actions/test/README.md index fbb8e2e..691e736 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -56,6 +56,15 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int +Native `coverage: github-code-quality` prepares Cobertura artifacts for the common +[CI reports workflow](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.md) +and its opt-in publication workflow. Set `report-group` to the outer calling job +and list every expected component in the collector. The default label is the +repository-relative working directory, or `root`. Multiple reports need explicit +stable labels. Reports must measure the PR head commit, not the PR merge commit. +Keep merge-result validation separately when required. No upload permission is +needed in this test action; only the publication job needs `code-quality: write`. + @@ -66,7 +75,7 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@4b801b911424c68370a3e713bc5404151ab4d772 # main +- uses: hoverkraft-tech/ci-github-python/actions/test@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 with: # uv project directory. # Default: `.` @@ -77,7 +86,13 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int command: uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml - # Publication only: `github`, `codecov`, or empty. Collection is controlled by command. + # Native GitHub coverage reports as a JSON array of file, language and optional label. + # Empty uses cobertura.xml; multiple reports require explicit unique labels. + # Every file must be Cobertura XML produced by the test command. Paths are relative + # to working-directory. Example: [{"file":"coverage.xml","language":"Python","label":"backend"}]. + coverage-reports: "" + + # Publication only: `github`, `github-code-quality`, `codecov`, or empty. Collection is controlled by command. # Default: `github` coverage: github @@ -95,7 +110,11 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------ | | **`working-directory`** | uv project directory. | **false** | `.` | | **`command`** | Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. | **false** | `uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml` | -| **`coverage`** | Publication only: `github`, `codecov`, or empty. Collection is controlled by command. | **false** | `github` | +| **`coverage-reports`** | Native GitHub coverage reports as a JSON array of file, language and optional label. | **false** | - | +| | Empty uses cobertura.xml; multiple reports require explicit unique labels. | | | +| | Every file must be Cobertura XML produced by the test command. Paths are relative | | | +| | to working-directory. Example: [{"file":"coverage.xml","language":"Python","label":"backend"}]. | | | +| **`coverage`** | Publication only: `github`, `github-code-quality`, `codecov`, or empty. Collection is controlled by command. | **false** | `github` | | **`report-group`** | Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. | **false** | - | @@ -107,9 +126,10 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Outputs -| **Output** | **Description** | -| ------------------------ | --------------------------------------------------------------- | -| **`report-artifact-id`** | Native report artifact ID. Empty when no reports were produced. | +| **Output** | **Description** | +| --------------------------------- | ----------------------------------------------------------------------------------------------- | +| **`native-coverage-artifact-id`** | Cobertura artifact for native GitHub publication, empty unless github-code-quality is selected. | +| **`report-artifact-id`** | Native report artifact ID. Empty when no reports were produced. | From 3ff04174f2c416727649bc09c9b7fb27ddc5d16a Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 26 Nov 2026 16:07:53 +0100 Subject: [PATCH 03/28] fix(coverage): consume corrected collection and isolate previews --- .github/workflows/__test-workflow-continuous-integration.yml | 3 ++- actions/test/action.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 0a9e659..0877e32 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -44,11 +44,12 @@ jobs: collect-native-coverage: name: Verify coverage from the primary runtime needs: fixture - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@71ce8b3ff53d6673617b19fa01d6637c916d4948 # coverage support (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@d52648f1645f1318908149af3f35b71b897ca566 # coverage support (PR #683, unreleased) permissions: contents: read pull-requests: write with: comment: false + concurrency-group: test-native-python-${{ github.run_id }}-${{ github.run_attempt }} job-results: ${{ toJSON(needs) }} coverage-reports: '[{"job":"fixture","label":"tests/python-project"}]' diff --git a/actions/test/action.yml b/actions/test/action.yml index fcc48aa..e67b902 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -113,7 +113,7 @@ runs: - name: Prepare native GitHub coverage id: native-coverage if: ${{ !cancelled() && steps.run.outcome != 'skipped' && inputs.coverage == 'github-code-quality' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/coverage-reports@71ce8b3ff53d6673617b19fa01d6637c916d4948 # coverage support (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/coverage-reports@d52648f1645f1318908149af3f35b71b897ca566 # coverage support (PR #683, unreleased) with: working-directory: ${{ steps.directory.outputs.absolute-path }} report-group: ${{ inputs.report-group || github.job }} From ea81a685d9e862c5f13215d8b95476a4c0aa70d8 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 26 Nov 2026 18:59:27 +0100 Subject: [PATCH 04/28] feat(reports)!: adopt the shared CI report contract --- .github/actions/parse-ci-reports/README.md | 132 ------------------ .../actions/parse-ci-reports/action.test.cjs | 52 ------- .github/actions/parse-ci-reports/action.yml | 62 -------- .github/linters/actionlint.yml | 15 ++ .github/workflows/__main-ci.yml | 1 + .github/workflows/__pull-request-ci.yml | 1 + .github/workflows/__release.yml | 1 + .github/workflows/__shared-ci.yml | 7 +- .github/workflows/__test-action-lint.yml | 10 +- .../__test-action-parse-ci-reports.yml | 65 --------- .../workflows/__test-action-setup-python.yml | 6 +- .github/workflows/__test-action-test.yml | 12 +- ...__test-workflow-continuous-integration.yml | 14 +- .github/workflows/continuous-integration.yml | 120 ++++++++++------ actions/lint/action.yml | 30 ++-- actions/test/action.test.cjs | 4 +- actions/test/action.yml | 102 ++++---------- package.json | 5 +- tests/config.test.cjs | 11 +- 19 files changed, 177 insertions(+), 473 deletions(-) delete mode 100644 .github/actions/parse-ci-reports/README.md delete mode 100644 .github/actions/parse-ci-reports/action.test.cjs delete mode 100644 .github/actions/parse-ci-reports/action.yml create mode 100644 .github/linters/actionlint.yml delete mode 100644 .github/workflows/__test-action-parse-ci-reports.yml diff --git a/.github/actions/parse-ci-reports/README.md b/.github/actions/parse-ci-reports/README.md deleted file mode 100644 index 49bf3aa..0000000 --- a/.github/actions/parse-ci-reports/README.md +++ /dev/null @@ -1,132 +0,0 @@ - - -# GitHub Action: Parse CI reports - -
- Parse CI reports -
- ---- - - - - - - - - -[![Marketplace](https://img.shields.io/badge/Marketplace-parse--ci--reports-blue?logo=github-actions)](https://github.com/marketplace/actions/parse-ci-reports) -[![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-python)](https://github.com/hoverkraft-tech/ci-github-python/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-python)](http://choosealicense.com/licenses/mit/) -[![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) - - - - - - - -## Overview - -Parse native reports, publish summaries and retain selected files in one artifact. Internal helper for lint and test. - - - - - - - - -## Usage - -```yaml -- uses: hoverkraft-tech/ci-github-python/.github/actions/parse-ci-reports@8fff11508ac0ee0064b432eea089a7bba4be702e # fix/artifact-discovery - with: - # Validated absolute project directory. - # This input is required. - directory: "" - - # Report paths or auto selectors passed to the common parser. - # Default: `auto:test` - report-paths: auto:test - - # Calling job ID used to group reports. - # This input is required. - group: "" - - # Title of the GitHub report summary. - # Default: `CI reports` - report-name: CI reports -``` - - - - - -## Inputs - -| **Input** | **Description** | **Required** | **Default** | -| ------------------ | ----------------------------------------------------------- | ------------ | ------------ | -| **`directory`** | Validated absolute project directory. | **true** | - | -| **`report-paths`** | Report paths or auto selectors passed to the common parser. | **false** | `auto:test` | -| **`group`** | Calling job ID used to group reports. | **true** | - | -| **`report-name`** | Title of the GitHub report summary. | **false** | `CI reports` | - - - - - - - - -## Outputs - -| **Output** | **Description** | -| ----------------- | ---------------------------------------------------------- | -| **`artifact-id`** | Uploaded artifact ID, or empty when no report files exist. | - - - - - - - - - - - - - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) for more details. - - - - - - - - -## License - -This project is licensed under the MIT License. - -SPDX-License-Identifier: MIT - -Copyright © 2026 hoverkraft-tech - -For more details, see the [license](http://choosealicense.com/licenses/mit/). - - - - - ---- - -This documentation was automatically generated by [CI Dokumentor](https://github.com/hoverkraft-tech/ci-dokumentor). - - - - diff --git a/.github/actions/parse-ci-reports/action.test.cjs b/.github/actions/parse-ci-reports/action.test.cjs deleted file mode 100644 index 6be51d8..0000000 --- a/.github/actions/parse-ci-reports/action.test.cjs +++ /dev/null @@ -1,52 +0,0 @@ -const assert = require("node:assert/strict"); -const fs = require("node:fs"); -const path = require("node:path"); -const test = require("node:test"); -const { - createWorkspace, - loadActionStep, -} = require("../../../tests/action-test-helpers.cjs"); - -const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor; - -test("report artifacts contain only parsed reports and use unique names", async (t) => { - const directory = createWorkspace(t); - const report = path.join(directory, "junit.xml"); - fs.writeFileSync(report, ""); - fs.writeFileSync( - path.join(directory, "unrelated-secret.txt"), - "not a report", - ); - const prepare = new AsyncFunction( - "core", - "process", - "require", - loadActionStep(path.join(__dirname, "action.yml"), "prepare").with.script, - ); - async function outputs(files, group = "outer-job") { - const result = {}; - await prepare( - { - setOutput: (key, value) => { - result[key] = value; - }, - }, - { - env: { - DIRECTORY: directory, - REPORT_FILES: JSON.stringify(files), - REPORT_GROUP: group, - GITHUB_RUN_ATTEMPT: "2", - }, - }, - require, - ); - return result; - } - assert.deepEqual(await outputs([]), {}); - const first = await outputs([report]); - assert.equal(first.files, report); - assert.match(first.name, /^ci-reports-2-outer-job-/); - assert.notEqual(first.name, (await outputs([report])).name); - await assert.rejects(() => outputs([report], "../bad-group"), /report-group/); -}); diff --git a/.github/actions/parse-ci-reports/action.yml b/.github/actions/parse-ci-reports/action.yml deleted file mode 100644 index 7d7a36a..0000000 --- a/.github/actions/parse-ci-reports/action.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: Parse CI reports -description: - Parse native reports, publish summaries and retain selected files in one artifact. Internal helper for lint and - test. -inputs: - directory: - description: Validated absolute project directory. - required: true - report-paths: - description: Report paths or auto selectors passed to the common parser. - default: auto:test - group: - description: Calling job ID used to group reports. - required: true - report-name: - description: Title of the GitHub report summary. - default: CI reports -outputs: - artifact-id: - description: Uploaded artifact ID, or empty when no report files exist. - value: ${{ steps.upload.outputs.artifact-id }} -runs: - using: composite - steps: - - id: parse - if: ${{ !cancelled() }} - uses: hoverkraft-tech/ci-github-common/actions/quality/parse-ci-reports@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 - with: - working-directory: ${{ inputs.directory }} - report-paths: | - ${{ inputs.report-paths }} - !**/.venv/** - !**/.git/** - !**/.cache/** - !**/vendor/** - report-name: ${{ inputs.report-name }} - output-format: annotations,summary,markdown - - id: prepare - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - DIRECTORY: ${{ inputs.directory }} - REPORT_FILES: ${{ steps.parse.outputs.parsed-files }} - REPORT_GROUP: ${{ inputs.group }} - with: - script: | - const files = JSON.parse(process.env.REPORT_FILES || '[]'); - if (!files.length) return; - const group = process.env.REPORT_GROUP; - if (!/^[\w-]+$/.test(group)) throw new Error('report-group must be a job ID.'); - core.setOutput('files', files.join('\n')); - core.setOutput('name', `ci-reports-${process.env.GITHUB_RUN_ATTEMPT}-${group}-${require('node:crypto').randomUUID()}`); - if: ${{ !cancelled() }} - - id: upload - if: ${{ !cancelled() && steps.prepare.outputs.files != '' }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - with: - name: ${{ steps.prepare.outputs.name }} - path: ${{ steps.prepare.outputs.files }} - include-hidden-files: true - if-no-files-found: error - retention-days: 7 diff --git a/.github/linters/actionlint.yml b/.github/linters/actionlint.yml new file mode 100644 index 0000000..1bb6ca0 --- /dev/null +++ b/.github/linters/actionlint.yml @@ -0,0 +1,15 @@ +# FIXME: Remove only the code-quality exception when Actionlint supports it. +# https://github.com/rhysd/actionlint/pull/674 +paths: + { + .github/workflows/__main-ci.yml: + { ignore: [^unknown permission scope "code-quality"\.] }, + .github/workflows/__pull-request-ci.yml: + { ignore: [^unknown permission scope "code-quality"\.] }, + .github/workflows/__release.yml: + { ignore: [^unknown permission scope "code-quality"\.] }, + .github/workflows/__shared-ci.yml: + { ignore: [^unknown permission scope "code-quality"\.] }, + .github/workflows/__test-workflow-continuous-integration.yml: + { ignore: [^unknown permission scope "code-quality"\.] }, + } diff --git a/.github/workflows/__main-ci.yml b/.github/workflows/__main-ci.yml index 6ed761c..87a9232 100644 --- a/.github/workflows/__main-ci.yml +++ b/.github/workflows/__main-ci.yml @@ -16,6 +16,7 @@ jobs: actions: read security-events: write id-token: write + code-quality: write release: needs: ci if: github.event_name != 'schedule' && vars.CI_BOT_APP_CLIENT_ID != '' diff --git a/.github/workflows/__pull-request-ci.yml b/.github/workflows/__pull-request-ci.yml index 7232af2..8b907bc 100644 --- a/.github/workflows/__pull-request-ci.yml +++ b/.github/workflows/__pull-request-ci.yml @@ -16,6 +16,7 @@ jobs: actions: read security-events: write id-token: write + code-quality: write "on": merge_group: null pull_request: diff --git a/.github/workflows/__release.yml b/.github/workflows/__release.yml index c41a8b4..78cc269 100644 --- a/.github/workflows/__release.yml +++ b/.github/workflows/__release.yml @@ -17,6 +17,7 @@ jobs: actions: read security-events: write id-token: write + code-quality: write release: name: Create and publish release needs: ci diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 61c44ac..b6285bc 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -5,7 +5,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) permissions: contents: read statuses: write @@ -28,6 +28,7 @@ jobs: contents: read pull-requests: write id-token: write + code-quality: write test-action-setup-python: uses: $/.github/workflows/__test-action-setup-python.yml permissions: @@ -48,7 +49,3 @@ jobs: uses: $/.github/workflows/__test-action-package-test.yml permissions: contents: read - test-action-parse-ci-reports: - uses: $/.github/workflows/__test-action-parse-ci-reports.yml - permissions: - contents: read diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index 7096e98..eecf6f1 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -16,13 +16,13 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) with: command: test:ci arguments: '["actions/lint/action.test.cjs"]' - coverage: "" - comment: "false" + coverage: "false" - name: Arrange - Install the project runtime and dependencies uses: $/actions/setup-python with: @@ -63,7 +63,7 @@ jobs: - name: Assert - Retained report contains the diagnostic shell: bash run: | - test -f "$REPORT_DIRECTORY/checkstyle.xml" - grep -q 'message="expected lint failure"' "$REPORT_DIRECTORY/checkstyle.xml" + test -f "$REPORT_DIRECTORY/ci-report.json" + grep -rq 'message="expected lint failure"' "$REPORT_DIRECTORY/reports" env: REPORT_DIRECTORY: ${{ runner.temp }}/lint-reports diff --git a/.github/workflows/__test-action-parse-ci-reports.yml b/.github/workflows/__test-action-parse-ci-reports.yml deleted file mode 100644 index dcf7fde..0000000 --- a/.github/workflows/__test-action-parse-ci-reports.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -name: Internal - Test parse-ci-reports action -"on": - workflow_call: null -permissions: {} -jobs: - reports: - runs-on: ubuntu-latest - timeout-minutes: 5 - permissions: - contents: read - outputs: - artifact-id: ${{ steps.report.outputs.artifact-id }} - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 - with: - command: test:ci - arguments: '[".github/actions/parse-ci-reports/action.test.cjs"]' - coverage: "" - comment: "false" - - name: Arrange - Empty report directory - run: mkdir -p "$RUNNER_TEMP/empty-reports" - - name: Act - Retain no reports - id: empty - uses: $/.github/actions/parse-ci-reports - with: - directory: ${{ runner.temp }}/empty-reports - group: reports - - name: Assert - No empty artifact is created - env: - ARTIFACT: ${{ steps.empty.outputs.artifact-id }} - run: test -z "$ARTIFACT" - - name: Arrange - One report and an unrelated private file - run: | - mkdir -p "$RUNNER_TEMP/report-fixture" - printf '%s\n' '' > "$RUNNER_TEMP/report-fixture/junit.xml" - printf '%s\n' 'not a report' > "$RUNNER_TEMP/report-fixture/private.txt" - - name: Act - Retain the selected report - id: report - uses: $/.github/actions/parse-ci-reports - with: - directory: ${{ runner.temp }}/report-fixture - group: reports - report-paths: junit.xml - verify: - needs: reports - runs-on: ubuntu-latest - timeout-minutes: 5 - permissions: - contents: read - steps: - - name: Assert - Artifact can be downloaded - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 - with: - artifact-ids: ${{ needs.reports.outputs.artifact-id }} - path: ${{ runner.temp }}/downloaded-reports - - name: Assert - Only the selected file was retained - run: | - test -f "$RUNNER_TEMP/downloaded-reports/junit.xml" - test ! -e "$RUNNER_TEMP/downloaded-reports/private.txt" - test "$(find "$RUNNER_TEMP/downloaded-reports" -type f | wc -l)" -eq 1 diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index 67c2ffd..ea410c0 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -14,13 +14,13 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) with: command: test:ci arguments: '["actions/setup-python/action.test.cjs"]' - coverage: "" - comment: "false" + coverage: "false" - name: Act - Detect the runtime and install dependencies uses: $/actions/setup-python with: diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 02e4807..ef5b6d7 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -15,14 +15,14 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) with: command: test:ci arguments: '["actions/test/action.test.cjs"]' - coverage: "" - comment: "false" + coverage: "false" - uses: $/actions/setup-python with: working-directory: tests/python-project @@ -40,7 +40,7 @@ jobs: command: |- printf '%s' 'failure' > junit.xml exit 17 - coverage: "" + coverage: "false" name: Act - Run a failing test command - name: Assert failures and reports uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -71,5 +71,5 @@ jobs: env: REPORT_DIRECTORY: ${{ runner.temp }}/failed-reports run: | - test -f "$REPORT_DIRECTORY/junit.xml" - grep -q 'message="expected"' "$REPORT_DIRECTORY/junit.xml" + test -f "$REPORT_DIRECTORY/ci-report.json" + grep -rq 'message="expected"' "$REPORT_DIRECTORY/reports" diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 0877e32..647ea36 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -12,13 +12,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) with: command: test:ci arguments: '["tests/config.test.cjs"]' - coverage: "" - comment: "false" + coverage: "false" fixture: uses: $/.github/workflows/continuous-integration.yml permissions: @@ -26,7 +26,7 @@ jobs: id-token: write with: working-directory: tests/python-project - test: '{"coverage":"github-code-quality","report-group":"fixture"}' + test: '{"coverage":true}' python-versions: '["3.13", "3.15"]' dependency-review: false package: '{"tests": "python -I -c \"from ci_python_fixture import add; assert add(2, 3) == 5\""}' @@ -44,12 +44,12 @@ jobs: collect-native-coverage: name: Verify coverage from the primary runtime needs: fixture - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@d52648f1645f1318908149af3f35b71b897ca566 # coverage support (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) permissions: contents: read pull-requests: write + code-quality: write + id-token: write with: comment: false - concurrency-group: test-native-python-${{ github.run_id }}-${{ github.run_attempt }} job-results: ${{ toJSON(needs) }} - coverage-reports: '[{"job":"fixture","label":"tests/python-project"}]' diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d16223b..e48935b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,7 +11,6 @@ # uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@main # permissions: # contents: read -# id-token: write # with: # working-directory: . # python-versions: '["3.13", "3.15"]' @@ -19,7 +18,7 @@ # # An empty versions input uses project detection once. The last matrix entry is # the primary version: lint, audit and package checks run there, and only -# that version publishes coverage. Tests run on every entry with fail-fast disabled. +# that version contributes coverage. Tests run on every entry with fail-fast disabled. # Duplicate, malformed and non-string versions are rejected. `runs-on` is a JSON # array of Linux labels and applies to every job, including configuration. # @@ -70,45 +69,52 @@ # Build backends execute code; Python has no general equivalent to npm's # `ignore-scripts` switch. The action does not publish to PyPI. # -# ### Reports and permissions +# ### Reports and coverage # -# Tests retain JUnit and supported coverage files for seven days, including after -# command failures. Lint retains parsed SARIF/Checkstyle reports. Only report files -# are uploaded, with unique names for parallel calls; a job producing no reports -# returns an empty `report-artifact-id`. Summaries and annotations work without PR -# write permissions. Individual PR comments are not created. +# Lint and test jobs retain native diagnostics in one artifact per execution. +# They post no PR comments and need no publication permissions. Configure native +# test reports (JUnit or TAP) and lint reports (for example Checkstyle or SARIF). +# Missing required reports fail even when the tool command exits successfully. +# Available reports are retained after failures. # -# Use the common -# [ci-reports workflow](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.yml) -# for consolidated comments after standalone producer jobs; set `report-group` to -# the outer calling job ID when required. Python JUnit and Cobertura reports use the common -# parser. +# Tests require Cobertura by default. The highest configured runtime contributes +# coverage; every runtime retains its test results. Set `test: '{"coverage":false}'` +# for tests that deliberately produce no Cobertura. The command still controls +# instrumentation. Custom `test.coverage-reports` describes Cobertura file paths, +# Linguist languages and stable component labels; it belongs beside the producer. +# Separate components stay separate. Merge shards in the framework first. # -# `test: '{"coverage":"codecov"}'` enables OIDC upload. The expected coverage file is -# `cobertura.xml`. A custom command must produce -# the applicable file. `coverage` controls publication, not collection, and an -# empty value still retains JUnit results. The reusable workflow declares -# `id-token: write` for Codecov and callers must grant it, including for default -# GitHub reports. Standalone GitHub reporting requires only read permissions. -# No repository-specific bot secrets are required by the public actions or workflow. +# Call the common workflow once after producer workflows. It reads their complete +# report plans from `needs`, regardless of calling job names: # -# See [setup-python](../../actions/setup-python/README.md), [lint](../../actions/lint/README.md), -# [test](../../actions/test/README.md) and [audit](../../actions/audit/README.md) -# for standalone action usage. Pin the workflow to a reviewed commit SHA in production. - ---- +# ```yaml +# reports: +# needs: [checks] +# if: ${{ always() }} +# uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@ +# permissions: +# contents: read +# pull-requests: write +# code-quality: write +# id-token: write +# with: +# job-results: ${{ toJSON(needs) }} +# coverage: github +# ``` # -# ## Native GitHub coverage +# Select `coverage: none` (default) for summaries, `github` for native GitHub +# coverage, or `codecov`. Both publishers consume validated Cobertura. Native +# GitHub coverage requires repository enablement and a default-branch baseline. +# The reporting workflow owns one CI comment and the `CI reports complete` check. +# Forks retain diagnostics without write operations. Partial reruns require +# rerunning all producers. Producer workflows test the PR head or push revision. +# +# Standalone action jobs forward their `report-plan` output. Custom outer matrices +# must forward a complete plan derived from their configuration; GitHub's last +# successful matrix output does not describe all executions. See the common +# [recording action](https://github.com/hoverkraft-tech/ci-github-common/tree/main/actions/quality/record-ci-reports) +# for the advanced contract. No collector-side coverage inventory is needed. # -# Select `test: '{"coverage":"github-code-quality","report-group":"backend"}'`. -# This tests the PR head commit; existing destinations keep their usual merge-ref -# checkout. Keep a separate merge-result test invocation when your policy requires it. -# Only the primary runtime publishes coverage. Optionally set test.coverage-reports -# to an array of {file, language, label} for multiple Cobertura components. -# Call the common ci-reports workflow with every expected job/label, then its -# publish-coverage workflow. Only publication needs code-quality: write. -# See [native coverage collection](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.md#native-github-coverage). - name: Python Continuous Integration "on": workflow_call: @@ -126,7 +132,7 @@ name: Python Continuous Integration type: string default: . python-versions: - description: JSON array of Python versions. The last entry runs lint, audit and package checks and publishes coverage. Empty runs project detection once. An empty entry uses the project version. + description: JSON array of Python versions. The last entry runs lint, audit and package checks and contributes coverage. Empty runs project detection once. An empty entry uses the project version. type: string default: "" lint: @@ -134,7 +140,7 @@ name: Python Continuous Integration type: string default: "true" test: - description: "true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports, report-group). false, null or empty disables tests. Only the primary runtime publishes coverage." + description: "true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports). false, null or empty disables tests. Coverage is collected once, on the primary runtime." type: string default: "true" audit: @@ -153,6 +159,14 @@ name: Python Continuous Integration description: Pinned uv release. type: string default: 0.13.9 + report-plan: + description: Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. + default: "" + type: string + outputs: + report-plan: + description: Complete expected report plan, consumed automatically by ci-reports. + value: ${{ jobs.configuration.outputs.report-plan }} permissions: {} jobs: configuration: @@ -165,6 +179,8 @@ jobs: test: ${{ steps.config.outputs.test }} package-enabled: ${{ steps.config.outputs.package-enabled }} package-tests: ${{ steps.config.outputs.package-tests }} + report-plan: ${{ steps.report-plan.outputs.report-plan }} + report-selections: ${{ steps.report-plan.outputs.selections }} steps: - id: config uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -173,6 +189,8 @@ jobs: LINT: ${{ inputs.lint }} TEST: ${{ inputs.test }} PACKAGE: ${{ inputs.package }} + DIRECTORY: ${{ inputs.working-directory }} + CHECKS: ${{ inputs.checks }} with: script: | const versions = process.env.VERSIONS.trim() ? JSON.parse(process.env.VERSIONS) : ['']; @@ -198,9 +216,7 @@ jobs: return config; } const lint = options('lint', process.env.LINT, {command: ''}); - const test = options('test', process.env.TEST, {"command": "uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml", "coverage": "github", "coverage-reports": [], "report-group": ""}); - if (test && test['report-group'] && !/^[\w-]+$/.test(test['report-group'])) throw new Error('test.report-group must be a job ID.'); - if (test && !['', 'github', 'github-code-quality', 'codecov'].includes(test.coverage)) throw new Error('test.coverage must be github, github-code-quality, codecov or empty.'); + const test = options('test', process.env.TEST, {"command": "uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml", "coverage": true, "coverage-reports": []}); let pkg; try { pkg = JSON.parse(process.env.PACKAGE.trim() || 'false'); } catch { throw new Error('package must be true, false or an object with tests.'); } @@ -215,6 +231,21 @@ jobs: core.setOutput('primary-version', versions.at(-1)); core.setOutput('lint', JSON.stringify(lint)); core.setOutput('test', JSON.stringify(test)); + + const directory = process.env.DIRECTORY || '.'; + const producers = []; + if (process.env.CHECKS === 'true' && lint) producers.push({key:'lint',type:'lint',directory,coverage:[]}); + if (process.env.CHECKS === 'true' && test) for (const version of versions) { + producers.push({key:'test-'+(version || 'project'),type:'test',directory, + coverage:version === versions.at(-1) && test.coverage ? (test['coverage-reports'].length ? test['coverage-reports'] : [{file:'cobertura.xml',language:'Python'}]) : []}); + } + core.setOutput('report-producers', producers); + - id: report-plan + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + with: + operation: plan + producers: ${{ steps.config.outputs.report-producers }} + report-plan: ${{ inputs.report-plan }} dependency-review: if: inputs.checks && inputs.dependency-review && github.event_name == 'pull_request' runs-on: ${{ fromJSON(inputs.runs-on) }} @@ -225,6 +256,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} - uses: actions/dependency-review-action@bbc44d14a204704ccc493733616cd1e93a0321ec # v5.0.1 lint: if: inputs.checks && needs.configuration.outputs.lint != 'null' @@ -245,6 +277,7 @@ jobs: with: working-directory: ${{ inputs.working-directory }} command: ${{ fromJSON(needs.configuration.outputs.lint).command }} + report-plan: ${{ toJSON(fromJSON(needs.configuration.outputs.report-selections).lint) }} test: if: inputs.checks && needs.configuration.outputs.test != 'null' needs: configuration @@ -252,11 +285,10 @@ jobs: timeout-minutes: 20 permissions: contents: read - id-token: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ fromJSON(needs.configuration.outputs.test).coverage == 'github-code-quality' && github.event.pull_request.head.sha || github.sha }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} persist-credentials: false - uses: $/actions/setup-python with: @@ -267,9 +299,9 @@ jobs: with: working-directory: ${{ inputs.working-directory }} command: ${{ fromJSON(needs.configuration.outputs.test).command }} - report-group: ${{ fromJSON(needs.configuration.outputs.test).report-group }} coverage-reports: ${{ fromJSON(needs.configuration.outputs.test).coverage-reports[0] && toJSON(fromJSON(needs.configuration.outputs.test).coverage-reports) || '' }} - coverage: ${{ matrix.version == needs.configuration.outputs.primary-version && fromJSON(needs.configuration.outputs.test).coverage || '' }} + coverage: ${{ matrix.version == needs.configuration.outputs.primary-version && fromJSON(needs.configuration.outputs.test).coverage && 'true' || 'false' }} + report-plan: ${{ toJSON(fromJSON(needs.configuration.outputs.report-selections)[format('test-{0}', matrix.version || 'project')]) }} strategy: fail-fast: false matrix: diff --git a/actions/lint/action.yml b/actions/lint/action.yml index c24e15f..7e44e3d 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -28,13 +28,16 @@ inputs: command: description: Trusted Bash command replacing the default checks. Generate SARIF or Checkstyle reports for annotations. default: "" - report-group: - description: Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. + report-plan: + description: Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. default: "" outputs: + report-plan: + description: Expected lint report metadata. Forward from standalone jobs. + value: ${{ steps.report-plan.outputs.report-plan }} report-artifact-id: - description: Native report artifact ID. Empty when no reports were produced. - value: ${{ steps.report-artifact.outputs.artifact-id }} + description: Native lint report bundle. + value: ${{ steps.reports.outputs.artifact-id }} runs: using: composite steps: @@ -42,6 +45,12 @@ runs: uses: hoverkraft-tech/ci-github-common/actions/working-directory@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 with: working-directory: ${{ inputs.working-directory }} + - id: report-plan + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + with: + operation: plan + report-plan: ${{ inputs.report-plan }} + producers: '[{"key":"lint","type":"lint","directory":${{ toJSON(steps.directory.outputs.workspace-relative-path || ''.'') }},"coverage":[]}]' - id: run shell: bash working-directory: ${{ steps.directory.outputs.absolute-path }} @@ -62,12 +71,11 @@ runs: uv run --locked black --check . || status=1 uv run --locked mypy . || status=1 exit "$status" - - name: Report lint results - id: report-artifact - if: ${{ !cancelled() && steps.run.outcome != 'skipped' }} - uses: $/.github/actions/parse-ci-reports + - id: reports + name: Record lint results + if: ${{ !cancelled() && steps.run.outcome != 'skipped' && steps.report-plan.outcome == 'success' }} + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) with: - directory: ${{ steps.directory.outputs.absolute-path }} + working-directory: ${{ steps.directory.outputs.absolute-path }} + report-plan: ${{ steps.report-plan.outputs.report-plan }} report-paths: auto:lint - report-name: Python lint results - group: ${{ inputs.report-group || github.job }} diff --git a/actions/test/action.test.cjs b/actions/test/action.test.cjs index b7b512b..2ca357f 100644 --- a/actions/test/action.test.cjs +++ b/actions/test/action.test.cjs @@ -25,7 +25,7 @@ test("custom commands retain quoting and fail without continuing to default tool assert.equal(fs.readFileSync(output, "utf8"), 'quotes " and $(not-executed)'); }); -test("test configuration rejects unsupported coverage destinations", (t) => { +test("test configuration rejects non-boolean coverage configuration", (t) => { const directory = createWorkspace(t); assert.notEqual( runActionStep(actionFile, "validate", directory, { @@ -36,7 +36,7 @@ test("test configuration rejects unsupported coverage destinations", (t) => { ); assert.equal( runActionStep(actionFile, "validate", directory, { - COVERAGE: "github-code-quality", + COVERAGE: "true", RACE: "true", }).status, 0, diff --git a/actions/test/action.yml b/actions/test/action.yml index e67b902..bb8c17e 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -1,41 +1,15 @@ --- name: Test Python description: | - Run project-locked pytest with JUnit and Cobertura coverage. + Run Python tests and retain native test and coverage reports. - Declare pytest and pytest-cov in the default uv dependency groups. Configure - coverage sources in `[tool.coverage.run]` to avoid measuring unrelated code. - A trusted Bash `command` replaces the default and must produce JUnit for test - reporting and `cobertura.xml` for coverage. The common parser handles both formats. + Use the matching setup action first. Commands must generate JUnit reports. + Coverage collection requires Cobertura XML. The test command controls instrumentation. - - - - Run [setup-python](../setup-python/README.md) first with the same `working-directory`. - - - - `coverage: "github"` is the default. Set `coverage: "codecov"` and grant the - job `id-token: write` for OIDC upload of `cobertura.xml`. An empty coverage - value disables publication while retaining JUnit; collection is controlled by - the command. Custom commands must produce the applicable report files. - - - - - Native reports survive command failures and are retained for seven days. - See the [continuous integration workflow](../../.github/workflows/continuous-integration.md#reports-and-permissions) for consolidated reporting and permissions. - - - - Native `coverage: github-code-quality` prepares Cobertura artifacts for the common - [CI reports workflow](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.md) - and its opt-in publication workflow. Set `report-group` to the outer calling job - and list every expected component in the collector. The default label is the - repository-relative working directory, or `root`. Multiple reports need explicit - stable labels. Reports must measure the PR head commit, not the PR merge commit. - Keep merge-result validation separately when required. No upload permission is - needed in this test action; only the publication job needs `code-quality: write`. + Forward report-plan from standalone jobs, or use the reusable CI workflow, which + exposes the complete expected plan automatically. Choose external coverage + publication once in the common ci-reports workflow. This action posts no comments + and needs no publication permissions. Available reports survive test failures. author: hoverkraft branding: icon: package @@ -48,25 +22,22 @@ inputs: description: Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. default: uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml coverage-reports: - description: | - Native GitHub coverage reports as a JSON array of file, language and optional label. - Empty uses cobertura.xml; multiple reports require explicit unique labels. - Every file must be Cobertura XML produced by the test command. Paths are relative - to working-directory. Example: [{"file":"coverage.xml","language":"Python","label":"backend"}]. + description: |- + Optional JSON array of Cobertura file, language and label. Empty uses cobertura.xml and the project directory as its stable label. default: "" coverage: - description: "Publication only: `github`, `github-code-quality`, `codecov`, or empty. Collection is controlled by command." - default: github - report-group: - description: Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. + description: Require and collect Cobertura coverage. Set false to retain only available native diagnostics. Instrumentation is controlled by the test command. + default: "true" + report-plan: + description: Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. default: "" outputs: - native-coverage-artifact-id: - description: Cobertura artifact for native GitHub publication, empty unless github-code-quality is selected. - value: ${{ steps.native-coverage.outputs.artifact-id }} + report-plan: + description: Expected report metadata. Forward from standalone jobs. + value: ${{ steps.report-plan.outputs.report-plan }} report-artifact-id: - description: Native report artifact ID. Empty when no reports were produced. - value: ${{ steps.report-artifact.outputs.artifact-id }} + description: Native report bundle, including available diagnostics after failures. + value: ${{ steps.reports.outputs.artifact-id }} runs: using: composite steps: @@ -79,7 +50,13 @@ runs: env: COVERAGE: ${{ inputs.coverage }} run: | - case "$COVERAGE" in github|github-code-quality|codecov|'') ;; *) echo 'coverage must be github, github-code-quality, codecov or empty.' >&2; exit 1 ;; esac + case "$COVERAGE" in true|false) ;; *) echo 'coverage must be true or false.' >&2; exit 1 ;; esac + - id: report-plan + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + with: + operation: plan + report-plan: ${{ inputs.report-plan }} + producers: '[{"key":"test","type":"test","directory":${{ toJSON(steps.directory.outputs.workspace-relative-path || ''.'') }},"coverage":${{ inputs.coverage == ''true'' && (inputs.coverage-reports || ''[{"file":"cobertura.xml","language":"Python"}]'') || ''[]'' }}}]' - id: run shell: bash working-directory: ${{ steps.directory.outputs.absolute-path }} @@ -93,28 +70,11 @@ runs: exit 1 fi bash --noprofile --norc -e -u -o pipefail -c "$COMMAND" - - name: Report test results - id: report-artifact - if: ${{ !cancelled() && steps.run.outcome != 'skipped' }} - uses: $/.github/actions/parse-ci-reports - with: - directory: ${{ steps.directory.outputs.absolute-path }} - report-paths: ${{ (inputs.coverage == 'github' || inputs.coverage == 'github-code-quality') && 'auto:test,auto:coverage' || 'auto:test' }} - report-name: Python test results - group: ${{ inputs.report-group || github.job }} - - name: Upload coverage to Codecov - if: ${{ !cancelled() && steps.run.outcome != 'skipped' && inputs.coverage == 'codecov' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/codecov@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 - with: - working-directory: ${{ steps.directory.outputs.absolute-path }} - files: cobertura.xml - fail-ci-if-error: "true" - - - name: Prepare native GitHub coverage - id: native-coverage - if: ${{ !cancelled() && steps.run.outcome != 'skipped' && inputs.coverage == 'github-code-quality' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/coverage-reports@d52648f1645f1318908149af3f35b71b897ca566 # coverage support (PR #683, unreleased) + - name: Record test results + id: reports + if: ${{ !cancelled() && steps.run.outcome != 'skipped' && steps.report-plan.outcome == 'success' }} + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) with: working-directory: ${{ steps.directory.outputs.absolute-path }} - report-group: ${{ inputs.report-group || github.job }} - reports: ${{ inputs.coverage-reports || '[{"file":"cobertura.xml","language":"Python"}]' }} + report-plan: ${{ steps.report-plan.outputs.report-plan }} + report-paths: auto:test diff --git a/package.json b/package.json index 6054c70..ba694cf 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,9 @@ "private": true, "description": "Development-only tests for GitHub Actions configuration", "scripts": { - "test": "node --test tests/*.test.cjs actions/*/*.test.cjs .github/actions/*/*.test.cjs", - "test:ci": "node --test" + "test": "node --test tests/*.test.cjs actions/*/*.test.cjs", + "test:ci": "node --test --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=coverage/junit.xml", + "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', {recursive:true})\"" }, "devDependencies": { "yaml": "2.9.1" diff --git a/tests/config.test.cjs b/tests/config.test.cjs index 0cc9117..3b52f05 100644 --- a/tests/config.test.cjs +++ b/tests/config.test.cjs @@ -61,17 +61,17 @@ test("disables checks and preserves explicitly supplied command bytes", async () } const command = 'printf "%s\n" "$VALUE"\nexit 17'; const result = await parse({ - TEST: JSON.stringify({ command, coverage: "" }), + TEST: JSON.stringify({ command, coverage: false }), }); assert.equal(JSON.parse(result.test).command, command); - assert.equal(JSON.parse(result.test).coverage, ""); + assert.equal(JSON.parse(result.test).coverage, false); assert.equal( JSON.parse((await parse({ LINT: "make lint" })).lint).command, "make lint", ); }); -test("rejects misspelled options, invalid types and unknown coverage providers", async () => { +test("rejects misspelled options, invalid types and non-boolean coverage options", async () => { for (const key of ["LINT", "TEST"]) { for (const value of [ "{", @@ -87,7 +87,7 @@ test("rejects misspelled options, invalid types and unknown coverage providers", ); } } - for (const coverage of ["unknown", false, null]) { + for (const coverage of ["unknown", "false", null]) { await assert.rejects(() => parse({ TEST: JSON.stringify({ coverage }) })); } }); @@ -116,8 +116,7 @@ test("distribution checks are opt-in and validate consumer commands", async () = test("preserves native coverage configuration and rejects ambiguous input types", async () => { const options = { - coverage: "github-code-quality", - "report-group": "backend", + coverage: true, "coverage-reports": [ { file: "custom.xml", language: "Python", label: "backend" }, ], From aac96a4977a2025432625385dd73aeeebb7af64a Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 26 Nov 2026 19:12:17 +0100 Subject: [PATCH 05/28] fix(reports): align producer integration and generated usage --- .github/workflows/__shared-ci.yml | 2 +- ...__test-workflow-continuous-integration.yml | 2 +- .github/workflows/continuous-integration.md | 114 +++++++++++------- .github/workflows/continuous-integration.yml | 2 +- actions/lint/README.md | 29 ++--- actions/lint/action.yml | 4 +- actions/test/README.md | 88 ++++---------- actions/test/action.yml | 4 +- 8 files changed, 112 insertions(+), 133 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index b6285bc..bdf4b45 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -5,7 +5,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) permissions: contents: read statuses: write diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 647ea36..7e773de 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -44,7 +44,7 @@ jobs: collect-native-coverage: name: Verify coverage from the primary runtime needs: fixture - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) permissions: contents: read pull-requests: write diff --git a/.github/workflows/continuous-integration.md b/.github/workflows/continuous-integration.md index 6f49ba2..bf0363a 100644 --- a/.github/workflows/continuous-integration.md +++ b/.github/workflows/continuous-integration.md @@ -2,12 +2,6 @@ # GitHub Reusable Workflow: Python Continuous Integration -
- Python Continuous Integration -
- ---- - @@ -41,7 +35,6 @@ jobs: uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@main permissions: contents: read - id-token: write with: working-directory: . python-versions: '["3.13", "3.15"]' @@ -49,7 +42,7 @@ jobs: An empty versions input uses project detection once. The last matrix entry is the primary version: lint, audit and package checks run there, and only -that version publishes coverage. Tests run on every entry with fail-fast disabled. +that version contributes coverage. Tests run on every entry with fail-fast disabled. Duplicate, malformed and non-string versions are rejected. `runs-on` is a JSON array of Linux labels and applies to every job, including configuration. @@ -100,36 +93,55 @@ build backend in `build-system.requires` for reproducible builds. Build backends execute code; Python has no general equivalent to npm's `ignore-scripts` switch. The action does not publish to PyPI. -### Reports and permissions +### Reports and coverage -Tests retain JUnit and supported coverage files for seven days, including after -command failures. Lint retains parsed SARIF/Checkstyle reports. Only report files -are uploaded, with unique names for parallel calls; a job producing no reports -returns an empty `report-artifact-id`. Summaries and annotations work without PR -write permissions. Individual PR comments are not created. +Lint and test jobs retain native diagnostics in one artifact per execution. +They post no PR comments and need no publication permissions. Configure native +test reports (JUnit or TAP) and lint reports (for example Checkstyle or SARIF). +Missing required reports fail even when the tool command exits successfully. +Available reports are retained after failures. -Use the common -[ci-reports workflow](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.yml) -for consolidated comments after standalone producer jobs; set `report-group` to -the outer calling job ID when required. Python JUnit and Cobertura reports use the common -parser. +Tests require Cobertura by default. The highest configured runtime contributes +coverage; every runtime retains its test results. Set `test: '{"coverage":false}'` +for tests that deliberately produce no Cobertura. The command still controls +instrumentation. Custom `test.coverage-reports` describes Cobertura file paths, +Linguist languages and stable component labels; it belongs beside the producer. +Separate components stay separate. Merge shards in the framework first. -`test: '{"coverage":"codecov"}'` enables OIDC upload. The expected coverage file is -`cobertura.xml`. A custom command must produce -the applicable file. `coverage` controls publication, not collection, and an -empty value still retains JUnit results. The reusable workflow declares -`id-token: write` for Codecov and callers must grant it, including for default -GitHub reports. Standalone GitHub reporting requires only read permissions. -No repository-specific bot secrets are required by the public actions or workflow. +Call the common workflow once after producer workflows. It reads their complete +report plans from `needs`, regardless of calling job names: + +```yaml +reports: + needs: [checks] + if: ${{ always() }} + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@ + permissions: + contents: read + pull-requests: write + code-quality: write + id-token: write + with: + job-results: ${{ toJSON(needs) }} + coverage: github +``` -See [setup-python](../../actions/setup-python/README.md), [lint](../../actions/lint/README.md), -[test](../../actions/test/README.md) and [audit](../../actions/audit/README.md) -for standalone action usage. Pin the workflow to a reviewed commit SHA in production. +Select `coverage: none` (default) for summaries, `github` for native GitHub +coverage, or `codecov`. Both publishers consume validated Cobertura. Native +GitHub coverage requires repository enablement and a default-branch baseline. +The reporting workflow owns one CI comment and the `CI reports complete` check. +Forks retain diagnostics without write operations. Partial reruns require +rerunning all producers. Producer workflows test the PR head or push revision. + +Standalone action jobs forward their `report-plan` output. Custom outer matrices +must forward a complete plan derived from their configuration; GitHub's last +successful matrix output does not describe all executions. See the common +[recording action](https://github.com/hoverkraft-tech/ci-github-common/tree/main/actions/quality/record-ci-reports) +for the advanced contract. No collector-side coverage inventory is needed. ### Permissions - **`contents`**: `read` -- **`id-token`**: `write` @@ -149,10 +161,9 @@ on: permissions: {} jobs: continuous-integration: - uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 + uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@ea81a685d9e862c5f13215d8b95476a4c0aa70d8 # feat/native-github-coverage permissions: contents: read - id-token: write with: # JSON array of Linux runner labels for all jobs. # Default: `["ubuntu-latest"]` @@ -166,14 +177,14 @@ jobs: # Default: `.` working-directory: . - # JSON array of Python versions. The last entry runs lint, audit and package checks and publishes coverage. Empty runs project detection once. An empty entry uses the project version. + # JSON array of Python versions. The last entry runs lint, audit and package checks and contributes coverage. Empty runs project detection once. An empty entry uses the project version. python-versions: "" # true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. # Default: `true` lint: "true" - # true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports, report-group). false, null or empty disables tests. Only the primary runtime publishes coverage. + # true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports). false, null or empty disables tests. Coverage is collected once, on the primary runtime. # Default: `true` test: "true" @@ -192,6 +203,9 @@ jobs: # Pinned uv release. # Default: `0.13.9` uv-version: 0.13.9 + + # Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. + report-plan: "" ``` @@ -202,18 +216,19 @@ jobs: ### Workflow Call Inputs -| **Input** | **Description** | **Required** | **Type** | **Default** | -| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | ------------------- | -| **`runs-on`** | JSON array of Linux runner labels for all jobs. | **false** | **string** | `["ubuntu-latest"]` | -| **`checks`** | Enable all checks, including distribution checks. | **false** | **boolean** | `true` | -| **`working-directory`** | One project directory inside the checkout. Use a caller matrix for multiple projects. | **false** | **string** | `.` | -| **`python-versions`** | JSON array of Python versions. The last entry runs lint, audit and package checks and publishes coverage. Empty runs project detection once. An empty entry uses the project version. | **false** | **string** | - | -| **`lint`** | true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. | **false** | **string** | `true` | -| **`test`** | true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports, report-group). false, null or empty disables tests. Only the primary runtime publishes coverage. | **false** | **string** | `true` | -| **`audit`** | Check production dependencies for known vulnerabilities. | **false** | **boolean** | `true` | -| **`dependency-review`** | Review dependency changes on pull requests. Requires GitHub dependency review availability. | **false** | **boolean** | `true` | -| **`package`** | false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. Does not publish packages. | **false** | **string** | `false` | -| **`uv-version`** | Pinned uv release. | **false** | **string** | `0.13.9` | +| **Input** | **Description** | **Required** | **Type** | **Default** | +| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | ------------------- | +| **`runs-on`** | JSON array of Linux runner labels for all jobs. | **false** | **string** | `["ubuntu-latest"]` | +| **`checks`** | Enable all checks, including distribution checks. | **false** | **boolean** | `true` | +| **`working-directory`** | One project directory inside the checkout. Use a caller matrix for multiple projects. | **false** | **string** | `.` | +| **`python-versions`** | JSON array of Python versions. The last entry runs lint, audit and package checks and contributes coverage. Empty runs project detection once. An empty entry uses the project version. | **false** | **string** | - | +| **`lint`** | true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. | **false** | **string** | `true` | +| **`test`** | true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports). false, null or empty disables tests. Coverage is collected once, on the primary runtime. | **false** | **string** | `true` | +| **`audit`** | Check production dependencies for known vulnerabilities. | **false** | **boolean** | `true` | +| **`dependency-review`** | Review dependency changes on pull requests. Requires GitHub dependency review availability. | **false** | **boolean** | `true` | +| **`package`** | false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. Does not publish packages. | **false** | **string** | `false` | +| **`uv-version`** | Pinned uv release. | **false** | **string** | `0.13.9` | +| **`report-plan`** | Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. | **false** | **string** | - | @@ -221,6 +236,13 @@ jobs: + +## Outputs + +| **Output** | **Description** | +| ----------------- | -------------------------------------------------------------------- | +| **`report-plan`** | Complete expected report plan, consumed automatically by ci-reports. | + diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e48935b..44d695b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -241,7 +241,7 @@ jobs: } core.setOutput('report-producers', producers); - id: report-plan - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) with: operation: plan producers: ${{ steps.config.outputs.report-producers }} diff --git a/actions/lint/README.md b/actions/lint/README.md index c3e75b8..a32cea6 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItcGFja2FnZSIgY29sb3I9ImJsdWUiPjxsaW5lIHgxPSIxNi41IiB5MT0iOS40IiB4Mj0iNy41IiB5Mj0iNC4yMSI+PC9saW5lPjxwYXRoIGQ9Ik0yMSAxNlY4YTIgMiAwIDAgMC0xLTEuNzNsLTctNGEyIDIgMCAwIDAtMiAwbC03IDRBMiAyIDAgMCAwIDMgOHY4YTIgMiAwIDAgMCAxIDEuNzNsNyA0YTIgMiAwIDAgMCAyIDBsNy00QTIgMiAwIDAgMCAyMSAxNnoiPjwvcGF0aD48cG9seWxpbmUgcG9pbnRzPSIzLjI3IDYuOTYgMTIgMTIuMDEgMjAuNzMgNi45NiI+PC9wb2x5bGluZT48bGluZSB4MT0iMTIiIHkxPSIyMi4wOCIgeDI9IjEyIiB5Mj0iMTIiPjwvbGluZT48L3N2Zz4=) GitHub Action: Lint Python -
- Lint Python -
- ---- - @@ -56,7 +50,7 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@4b801b911424c68370a3e713bc5404151ab4d772 # main +- uses: hoverkraft-tech/ci-github-python/actions/lint@ea81a685d9e862c5f13215d8b95476a4c0aa70d8 # feat/native-github-coverage with: # uv project directory. # Default: `.` @@ -65,8 +59,8 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int # Trusted Bash command replacing the default checks. Generate SARIF or Checkstyle reports for annotations. command: "" - # Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. - report-group: "" + # Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. + report-plan: "" ``` @@ -75,11 +69,11 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| ----------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | -| **`working-directory`** | uv project directory. | **false** | `.` | -| **`command`** | Trusted Bash command replacing the default checks. Generate SARIF or Checkstyle reports for annotations. | **false** | - | -| **`report-group`** | Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. | **false** | - | +| **Input** | **Description** | **Required** | **Default** | +| ----------------------- | -------------------------------------------------------------------------------------------------------- | ------------ | ----------- | +| **`working-directory`** | uv project directory. | **false** | `.` | +| **`command`** | Trusted Bash command replacing the default checks. Generate SARIF or Checkstyle reports for annotations. | **false** | - | +| **`report-plan`** | Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. | **false** | - | @@ -90,9 +84,10 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Outputs -| **Output** | **Description** | -| ------------------------ | --------------------------------------------------------------- | -| **`report-artifact-id`** | Native report artifact ID. Empty when no reports were produced. | +| **Output** | **Description** | +| ------------------------ | ------------------------------------------------------------ | +| **`report-plan`** | Expected lint report metadata. Forward from standalone jobs. | +| **`report-artifact-id`** | Native lint report bundle. | diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 7e44e3d..d328919 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -46,7 +46,7 @@ runs: with: working-directory: ${{ inputs.working-directory }} - id: report-plan - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) with: operation: plan report-plan: ${{ inputs.report-plan }} @@ -74,7 +74,7 @@ runs: - id: reports name: Record lint results if: ${{ !cancelled() && steps.run.outcome != 'skipped' && steps.report-plan.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) with: working-directory: ${{ steps.directory.outputs.absolute-path }} report-plan: ${{ steps.report-plan.outputs.report-plan }} diff --git a/actions/test/README.md b/actions/test/README.md index 691e736..3c5b4ea 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItcGFja2FnZSIgY29sb3I9ImJsdWUiPjxsaW5lIHgxPSIxNi41IiB5MT0iOS40IiB4Mj0iNy41IiB5Mj0iNC4yMSI+PC9saW5lPjxwYXRoIGQ9Ik0yMSAxNlY4YTIgMiAwIDAgMC0xLTEuNzNsLTctNGEyIDIgMCAwIDAtMiAwbC03IDRBMiAyIDAgMCAwIDMgOHY4YTIgMiAwIDAgMCAxIDEuNzNsNyA0YTIgMiAwIDAgMCAyIDBsNy00QTIgMiAwIDAgMCAyMSAxNnoiPjwvcGF0aD48cG9seWxpbmUgcG9pbnRzPSIzLjI3IDYuOTYgMTIgMTIuMDEgMjAuNzMgNi45NiI+PC9wb2x5bGluZT48bGluZSB4MT0iMTIiIHkxPSIyMi4wOCIgeDI9IjEyIiB5Mj0iMTIiPjwvbGluZT48L3N2Zz4=) GitHub Action: Test Python -
- Test Python -
- ---- - @@ -29,41 +23,15 @@ ## Overview -Run project-locked pytest with JUnit and Cobertura coverage. - -Declare pytest and pytest-cov in the default uv dependency groups. Configure -coverage sources in `[tool.coverage.run]` to avoid measuring unrelated code. -A trusted Bash `command` replaces the default and must produce JUnit for test -reporting and `cobertura.xml` for coverage. The common parser handles both formats. - - - - -Run [setup-python](../setup-python/README.md) first with the same `working-directory`. +Run Python tests and retain native test and coverage reports. - - -`coverage: "github"` is the default. Set `coverage: "codecov"` and grant the -job `id-token: write` for OIDC upload of `cobertura.xml`. An empty coverage -value disables publication while retaining JUnit; collection is controlled by -the command. Custom commands must produce the applicable report files. - - - - -Native reports survive command failures and are retained for seven days. -See the [continuous integration workflow](../../.github/workflows/continuous-integration.md#reports-and-permissions) for consolidated reporting and permissions. - - +Use the matching setup action first. Commands must generate JUnit reports. +Coverage collection requires Cobertura XML. The test command controls instrumentation. -Native `coverage: github-code-quality` prepares Cobertura artifacts for the common -[CI reports workflow](https://github.com/hoverkraft-tech/ci-github-common/blob/main/.github/workflows/ci-reports.md) -and its opt-in publication workflow. Set `report-group` to the outer calling job -and list every expected component in the collector. The default label is the -repository-relative working directory, or `root`. Multiple reports need explicit -stable labels. Reports must measure the PR head commit, not the PR merge commit. -Keep merge-result validation separately when required. No upload permission is -needed in this test action; only the publication job needs `code-quality: write`. +Forward report-plan from standalone jobs, or use the reusable CI workflow, which +exposes the complete expected plan automatically. Choose external coverage +publication once in the common ci-reports workflow. This action posts no comments +and needs no publication permissions. Available reports survive test failures. @@ -75,7 +43,7 @@ needed in this test action; only the publication job needs `code-quality: write` ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 +- uses: hoverkraft-tech/ci-github-python/actions/test@ea81a685d9e862c5f13215d8b95476a4c0aa70d8 # feat/native-github-coverage with: # uv project directory. # Default: `.` @@ -86,18 +54,15 @@ needed in this test action; only the publication job needs `code-quality: write` command: uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml - # Native GitHub coverage reports as a JSON array of file, language and optional label. - # Empty uses cobertura.xml; multiple reports require explicit unique labels. - # Every file must be Cobertura XML produced by the test command. Paths are relative - # to working-directory. Example: [{"file":"coverage.xml","language":"Python","label":"backend"}]. + # Optional JSON array of Cobertura file, language and label. Empty uses cobertura.xml and the project directory as its stable label. coverage-reports: "" - # Publication only: `github`, `github-code-quality`, `codecov`, or empty. Collection is controlled by command. - # Default: `github` - coverage: github + # Require and collect Cobertura coverage. Set false to retain only available native diagnostics. Instrumentation is controlled by the test command. + # Default: `true` + coverage: "true" - # Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. - report-group: "" + # Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. + report-plan: "" ``` @@ -106,16 +71,13 @@ needed in this test action; only the publication job needs `code-quality: write` ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------ | -| **`working-directory`** | uv project directory. | **false** | `.` | -| **`command`** | Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. | **false** | `uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml` | -| **`coverage-reports`** | Native GitHub coverage reports as a JSON array of file, language and optional label. | **false** | - | -| | Empty uses cobertura.xml; multiple reports require explicit unique labels. | | | -| | Every file must be Cobertura XML produced by the test command. Paths are relative | | | -| | to working-directory. Example: [{"file":"coverage.xml","language":"Python","label":"backend"}]. | | | -| **`coverage`** | Publication only: `github`, `github-code-quality`, `codecov`, or empty. Collection is controlled by command. | **false** | `github` | -| **`report-group`** | Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. | **false** | - | +| **Input** | **Description** | **Required** | **Default** | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------ | +| **`working-directory`** | uv project directory. | **false** | `.` | +| **`command`** | Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. | **false** | `uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml` | +| **`coverage-reports`** | Optional JSON array of Cobertura file, language and label. Empty uses cobertura.xml and the project directory as its stable label. | **false** | - | +| **`coverage`** | Require and collect Cobertura coverage. Set false to retain only available native diagnostics. Instrumentation is controlled by the test command. | **false** | `true` | +| **`report-plan`** | Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. | **false** | - | @@ -126,10 +88,10 @@ needed in this test action; only the publication job needs `code-quality: write` ## Outputs -| **Output** | **Description** | -| --------------------------------- | ----------------------------------------------------------------------------------------------- | -| **`native-coverage-artifact-id`** | Cobertura artifact for native GitHub publication, empty unless github-code-quality is selected. | -| **`report-artifact-id`** | Native report artifact ID. Empty when no reports were produced. | +| **Output** | **Description** | +| ------------------------ | --------------------------------------------------------------------- | +| **`report-plan`** | Expected report metadata. Forward from standalone jobs. | +| **`report-artifact-id`** | Native report bundle, including available diagnostics after failures. | diff --git a/actions/test/action.yml b/actions/test/action.yml index bb8c17e..b5f281d 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -52,7 +52,7 @@ runs: run: | case "$COVERAGE" in true|false) ;; *) echo 'coverage must be true or false.' >&2; exit 1 ;; esac - id: report-plan - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) with: operation: plan report-plan: ${{ inputs.report-plan }} @@ -73,7 +73,7 @@ runs: - name: Record test results id: reports if: ${{ !cancelled() && steps.run.outcome != 'skipped' && steps.report-plan.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@5ea25078a15fe361993382872c03a63fd667c11a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) with: working-directory: ${{ steps.directory.outputs.absolute-path }} report-plan: ${{ steps.report-plan.outputs.report-plan }} From c257ef9b192b01b7e4eaa84be41ce8a7599bff33 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 01:31:31 +0100 Subject: [PATCH 06/28] feat(reports)!: validate Python results before consolidated publication --- .github/linters/actionlint.yml | 2 - .github/workflows/__shared-ci.yml | 31 +++- .github/workflows/__test-action-lint.yml | 38 ++--- .../workflows/__test-action-setup-python.yml | 6 +- .github/workflows/__test-action-test.yml | 45 ++---- ...__test-workflow-continuous-integration.yml | 21 +-- .github/workflows/continuous-integration.md | 102 ++++--------- .github/workflows/continuous-integration.yml | 137 +++++++----------- actions/lint/README.md | 47 +++--- actions/lint/action.yml | 73 +++++----- actions/test/README.md | 52 +++---- actions/test/action.test.cjs | 26 ++++ actions/test/action.yml | 96 +++++++----- tests/config.test.cjs | 18 +-- 14 files changed, 323 insertions(+), 371 deletions(-) diff --git a/.github/linters/actionlint.yml b/.github/linters/actionlint.yml index 1bb6ca0..cf843da 100644 --- a/.github/linters/actionlint.yml +++ b/.github/linters/actionlint.yml @@ -10,6 +10,4 @@ paths: { ignore: [^unknown permission scope "code-quality"\.] }, .github/workflows/__shared-ci.yml: { ignore: [^unknown permission scope "code-quality"\.] }, - .github/workflows/__test-workflow-continuous-integration.yml: - { ignore: [^unknown permission scope "code-quality"\.] }, } diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index bdf4b45..294fde3 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -1,11 +1,10 @@ ---- name: Internal - Common Continuous Integration tasks "on": workflow_call: null permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) permissions: contents: read statuses: write @@ -26,26 +25,50 @@ jobs: uses: $/.github/workflows/__test-workflow-continuous-integration.yml permissions: contents: read - pull-requests: write id-token: write - code-quality: write + actions: read test-action-setup-python: uses: $/.github/workflows/__test-action-setup-python.yml permissions: contents: read + actions: read test-action-lint: uses: $/.github/workflows/__test-action-lint.yml permissions: contents: read + actions: read test-action-test: uses: $/.github/workflows/__test-action-test.yml permissions: contents: read + actions: read test-action-audit: uses: $/.github/workflows/__test-action-audit.yml permissions: contents: read + actions: read test-action-package-test: uses: $/.github/workflows/__test-action-package-test.yml permissions: contents: read + actions: read + reports: + if: ${{ !cancelled() }} + needs: + - linter + - test + - test-action-setup-python + - test-action-lint + - test-action-test + - test-action-audit + - test-action-package-test + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + permissions: + actions: read + contents: read + pull-requests: write + code-quality: write + id-token: write + security-events: write + with: + job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index eecf6f1..be10c2e 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -1,4 +1,3 @@ ---- name: Internal - Test lint action "on": workflow_call: null @@ -9,8 +8,9 @@ jobs: timeout-minutes: 20 permissions: contents: read + actions: read outputs: - artifact-id: ${{ steps.failed-lint.outputs.report-artifact-id }} + artifact-id: ${{ steps.check.outputs.report-artifact-id }} steps: - name: Arrange - Check out the repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -18,11 +18,12 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 with: command: test:ci arguments: '["actions/lint/action.test.cjs"]' - coverage: "false" + coverage: none + comment: "false" - name: Arrange - Install the project runtime and dependencies uses: $/actions/setup-python with: @@ -31,39 +32,24 @@ jobs: uses: $/actions/lint with: working-directory: tests/python-project - - name: Act - Retain diagnostics from a failing command - uses: $/actions/lint - with: - working-directory: tests/python-project - command: | - printf '%s\n' '' > checkstyle.xml - exit 23 - id: failed-lint - continue-on-error: true - - name: Assert - Failure propagates and reports survive - shell: bash - run: | - test "$OUTCOME" = failure - test -n "$ARTIFACT" - env: - OUTCOME: ${{ steps.failed-lint.outcome }} - ARTIFACT: ${{ steps.failed-lint.outputs.report-artifact-id }} + id: check verify: needs: lint runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: read + actions: read steps: - name: Assert - Download retained lint reports uses: hoverkraft-tech/ci-github-common/actions/download-artifact@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 with: artifact-ids: ${{ needs.lint.outputs.artifact-id }} - path: ${{ runner.temp }}/lint-reports - - name: Assert - Retained report contains the diagnostic + path: ${{ runner.temp }}/retained-reports + - name: Assert - Native reports and validation result are retained shell: bash run: | - test -f "$REPORT_DIRECTORY/ci-report.json" - grep -rq 'message="expected lint failure"' "$REPORT_DIRECTORY/reports" + test -f "$REPORT_DIRECTORY/result.json" + test -s "$REPORT_DIRECTORY/reports/ruff.sarif" env: - REPORT_DIRECTORY: ${{ runner.temp }}/lint-reports + REPORT_DIRECTORY: ${{ runner.temp }}/retained-reports diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index ea410c0..4781b7d 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -1,4 +1,3 @@ ---- name: Internal - Test setup-python action "on": workflow_call: null @@ -16,11 +15,12 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 with: command: test:ci arguments: '["actions/setup-python/action.test.cjs"]' - coverage: "false" + coverage: none + comment: "false" - name: Act - Detect the runtime and install dependencies uses: $/actions/setup-python with: diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index ef5b6d7..7165a2e 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -1,4 +1,3 @@ ---- name: Internal - Test test action "on": workflow_call: null @@ -9,8 +8,9 @@ jobs: timeout-minutes: 20 permissions: contents: read + actions: read outputs: - artifact-id: ${{ steps.failed-test.outputs.report-artifact-id }} + artifact-id: ${{ steps.check.outputs.report-artifact-id }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -18,58 +18,37 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 with: command: test:ci arguments: '["actions/test/action.test.cjs"]' - coverage: "false" + coverage: none + comment: "false" - uses: $/actions/setup-python with: working-directory: tests/python-project name: Arrange - Install dependencies - - id: test + - id: check uses: $/actions/test with: working-directory: tests/python-project name: Act - Run default tests - - id: failed-test - continue-on-error: true - uses: $/actions/test - with: - working-directory: tests/python-project - command: |- - printf '%s' 'failure' > junit.xml - exit 17 - coverage: "false" - name: Act - Run a failing test command - - name: Assert failures and reports - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - SUCCESS_ARTIFACT: ${{ steps.test.outputs.report-artifact-id }} - FAILURE_ARTIFACT: ${{ steps.failed-test.outputs.report-artifact-id }} - TEST_OUTCOME: ${{ steps.failed-test.outcome }} - with: - script: | - const assert = require('node:assert/strict'); - assert.equal(process.env.TEST_OUTCOME, 'failure'); - assert.ok(process.env.SUCCESS_ARTIFACT, 'Successful tests retain reports'); - assert.ok(process.env.FAILURE_ARTIFACT, 'Failed tests retain reports'); - assert.notEqual(process.env.SUCCESS_ARTIFACT, process.env.FAILURE_ARTIFACT); verify: needs: test runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: read + actions: read steps: - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 with: artifact-ids: ${{ needs.test.outputs.artifact-id }} - path: ${{ runner.temp }}/failed-reports - - name: Verify retained failure report + path: ${{ runner.temp }}/retained-reports + - name: Assert - Native reports and validation result are retained shell: bash env: - REPORT_DIRECTORY: ${{ runner.temp }}/failed-reports + REPORT_DIRECTORY: ${{ runner.temp }}/retained-reports run: | - test -f "$REPORT_DIRECTORY/ci-report.json" - grep -rq 'message="expected"' "$REPORT_DIRECTORY/reports" + test -f "$REPORT_DIRECTORY/result.json" + test -s "$REPORT_DIRECTORY/reports/junit.xml" diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 7e773de..9f0ec8c 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -1,4 +1,3 @@ ---- name: Internal - Test continuous integration workflow "on": workflow_call: null @@ -14,16 +13,18 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@11636b817040a2a7d61b389c28fa1b401c37a2fa # unified reports (PR #624, unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 with: command: test:ci arguments: '["tests/config.test.cjs"]' - coverage: "false" + coverage: none + comment: "false" fixture: uses: $/.github/workflows/continuous-integration.yml permissions: contents: read id-token: write + actions: read with: working-directory: tests/python-project test: '{"coverage":true}' @@ -35,21 +36,9 @@ jobs: permissions: contents: read id-token: write + actions: read with: checks: false working-directory: must-not-exist lint: exit 99 test: exit 99 - - collect-native-coverage: - name: Verify coverage from the primary runtime - needs: fixture - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) - permissions: - contents: read - pull-requests: write - code-quality: write - id-token: write - with: - comment: false - job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/continuous-integration.md b/.github/workflows/continuous-integration.md index bf0363a..b20a657 100644 --- a/.github/workflows/continuous-integration.md +++ b/.github/workflows/continuous-integration.md @@ -34,13 +34,14 @@ jobs: python: uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@main permissions: + actions: read contents: read with: working-directory: . python-versions: '["3.13", "3.15"]' ``` -An empty versions input uses project detection once. The last matrix entry is +An empty versions input uses project detection once. The highest configured version is the primary version: lint, audit and package checks run there, and only that version contributes coverage. Tests run on every entry with fail-fast disabled. Duplicate, malformed and non-string versions are rejected. `runs-on` is a JSON @@ -95,52 +96,23 @@ Build backends execute code; Python has no general equivalent to npm's ### Reports and coverage -Lint and test jobs retain native diagnostics in one artifact per execution. -They post no PR comments and need no publication permissions. Configure native -test reports (JUnit or TAP) and lint reports (for example Checkstyle or SARIF). -Missing required reports fail even when the tool command exits successfully. -Available reports are retained after failures. +Every runtime retains detailed test results. The highest configured version runs +lint and coverage once. Default pytest commands disable coverage instrumentation +on other versions. Custom commands receive CI_TEST_COVERAGE and CI_REPORTS_DIR. +Outputs are validated by the test action, including after command failure. -Tests require Cobertura by default. The highest configured runtime contributes -coverage; every runtime retains its test results. Set `test: '{"coverage":false}'` -for tests that deliberately produce no Cobertura. The command still controls -instrumentation. Custom `test.coverage-reports` describes Cobertura file paths, -Linguist languages and stable component labels; it belongs beside the producer. -Separate components stay separate. Merge shards in the framework first. - -Call the common workflow once after producer workflows. It reads their complete -report plans from `needs`, regardless of calling job names: - -```yaml -reports: - needs: [checks] - if: ${{ always() }} - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@ - permissions: - contents: read - pull-requests: write - code-quality: write - id-token: write - with: - job-results: ${{ toJSON(needs) }} - coverage: github -``` - -Select `coverage: none` (default) for summaries, `github` for native GitHub -coverage, or `codecov`. Both publishers consume validated Cobertura. Native -GitHub coverage requires repository enablement and a default-branch baseline. -The reporting workflow owns one CI comment and the `CI reports complete` check. -Forks retain diagnostics without write operations. Partial reruns require -rerunning all producers. Producer workflows test the PR head or push revision. - -Standalone action jobs forward their `report-plan` output. Custom outer matrices -must forward a complete plan derived from their configuration; GitHub's last -successful matrix output does not describe all executions. See the common -[recording action](https://github.com/hoverkraft-tech/ci-github-common/tree/main/actions/quality/record-ci-reports) -for the advanced contract. No collector-side coverage inventory is needed. +Call ci-github-common's ci-reports.yml once after all producer jobs with +job-results: toJSON(needs). No report plans or artifact IDs need forwarding. +Producer calls need actions: read and contents: read. The reporting caller grants +actions: read, contents: read, pull-requests: write, code-quality: write, +id-token: write and security-events: write; internal publisher jobs narrow these. +Lint and test results default to annotations. Coverage defaults to GitHub when +available, then a comment or summary. Choose destinations using lint-reporters, +test-results-reporters and test-coverage-reporters on that single reporting call. ### Permissions +- **`actions`**: `read` - **`contents`**: `read` @@ -161,8 +133,9 @@ on: permissions: {} jobs: continuous-integration: - uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@ea81a685d9e862c5f13215d8b95476a4c0aa70d8 # feat/native-github-coverage + uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@aac96a4977a2025432625385dd73aeeebb7af64a # feat/native-github-coverage permissions: + actions: read contents: read with: # JSON array of Linux runner labels for all jobs. @@ -177,14 +150,14 @@ jobs: # Default: `.` working-directory: . - # JSON array of Python versions. The last entry runs lint, audit and package checks and contributes coverage. Empty runs project detection once. An empty entry uses the project version. + # JSON array of Python versions. The highest configured version runs lint, audit, package checks and coverage; every version retains test results. Empty uses project detection once. python-versions: "" - # true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. + # true for defaults, a Bash command, or JSON options (command, lint-results). false, null or empty disables lint. # Default: `true` lint: "true" - # true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports). false, null or empty disables tests. Coverage is collected once, on the primary runtime. + # true for defaults, a Bash command, or JSON options (command, coverage, test-results, test-coverage). false, null or empty disables tests. # Default: `true` test: "true" @@ -203,9 +176,6 @@ jobs: # Pinned uv release. # Default: `0.13.9` uv-version: 0.13.9 - - # Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. - report-plan: "" ``` @@ -216,19 +186,18 @@ jobs: ### Workflow Call Inputs -| **Input** | **Description** | **Required** | **Type** | **Default** | -| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | ------------------- | -| **`runs-on`** | JSON array of Linux runner labels for all jobs. | **false** | **string** | `["ubuntu-latest"]` | -| **`checks`** | Enable all checks, including distribution checks. | **false** | **boolean** | `true` | -| **`working-directory`** | One project directory inside the checkout. Use a caller matrix for multiple projects. | **false** | **string** | `.` | -| **`python-versions`** | JSON array of Python versions. The last entry runs lint, audit and package checks and contributes coverage. Empty runs project detection once. An empty entry uses the project version. | **false** | **string** | - | -| **`lint`** | true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. | **false** | **string** | `true` | -| **`test`** | true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports). false, null or empty disables tests. Coverage is collected once, on the primary runtime. | **false** | **string** | `true` | -| **`audit`** | Check production dependencies for known vulnerabilities. | **false** | **boolean** | `true` | -| **`dependency-review`** | Review dependency changes on pull requests. Requires GitHub dependency review availability. | **false** | **boolean** | `true` | -| **`package`** | false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. Does not publish packages. | **false** | **string** | `false` | -| **`uv-version`** | Pinned uv release. | **false** | **string** | `0.13.9` | -| **`report-plan`** | Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. | **false** | **string** | - | +| **Input** | **Description** | **Required** | **Type** | **Default** | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | ------------------- | +| **`runs-on`** | JSON array of Linux runner labels for all jobs. | **false** | **string** | `["ubuntu-latest"]` | +| **`checks`** | Enable all checks, including distribution checks. | **false** | **boolean** | `true` | +| **`working-directory`** | One project directory inside the checkout. Use a caller matrix for multiple projects. | **false** | **string** | `.` | +| **`python-versions`** | JSON array of Python versions. The highest configured version runs lint, audit, package checks and coverage; every version retains test results. Empty uses project detection once. | **false** | **string** | - | +| **`lint`** | true for defaults, a Bash command, or JSON options (command, lint-results). false, null or empty disables lint. | **false** | **string** | `true` | +| **`test`** | true for defaults, a Bash command, or JSON options (command, coverage, test-results, test-coverage). false, null or empty disables tests. | **false** | **string** | `true` | +| **`audit`** | Check production dependencies for known vulnerabilities. | **false** | **boolean** | `true` | +| **`dependency-review`** | Review dependency changes on pull requests. Requires GitHub dependency review availability. | **false** | **boolean** | `true` | +| **`package`** | false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. Does not publish packages. | **false** | **string** | `false` | +| **`uv-version`** | Pinned uv release. | **false** | **string** | `0.13.9` | @@ -236,13 +205,6 @@ jobs: - -## Outputs - -| **Output** | **Description** | -| ----------------- | -------------------------------------------------------------------- | -| **`report-plan`** | Complete expected report plan, consumed automatically by ci-reports. | - diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 44d695b..cf20331 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -10,13 +10,14 @@ # python: # uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@main # permissions: +# actions: read # contents: read # with: # working-directory: . # python-versions: '["3.13", "3.15"]' # ``` # -# An empty versions input uses project detection once. The last matrix entry is +# An empty versions input uses project detection once. The highest configured version is # the primary version: lint, audit and package checks run there, and only # that version contributes coverage. Tests run on every entry with fail-fast disabled. # Duplicate, malformed and non-string versions are rejected. `runs-on` is a JSON @@ -71,49 +72,19 @@ # # ### Reports and coverage # -# Lint and test jobs retain native diagnostics in one artifact per execution. -# They post no PR comments and need no publication permissions. Configure native -# test reports (JUnit or TAP) and lint reports (for example Checkstyle or SARIF). -# Missing required reports fail even when the tool command exits successfully. -# Available reports are retained after failures. +# Every runtime retains detailed test results. The highest configured version runs +# lint and coverage once. Default pytest commands disable coverage instrumentation +# on other versions. Custom commands receive CI_TEST_COVERAGE and CI_REPORTS_DIR. +# Outputs are validated by the test action, including after command failure. # -# Tests require Cobertura by default. The highest configured runtime contributes -# coverage; every runtime retains its test results. Set `test: '{"coverage":false}'` -# for tests that deliberately produce no Cobertura. The command still controls -# instrumentation. Custom `test.coverage-reports` describes Cobertura file paths, -# Linguist languages and stable component labels; it belongs beside the producer. -# Separate components stay separate. Merge shards in the framework first. -# -# Call the common workflow once after producer workflows. It reads their complete -# report plans from `needs`, regardless of calling job names: -# -# ```yaml -# reports: -# needs: [checks] -# if: ${{ always() }} -# uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@ -# permissions: -# contents: read -# pull-requests: write -# code-quality: write -# id-token: write -# with: -# job-results: ${{ toJSON(needs) }} -# coverage: github -# ``` -# -# Select `coverage: none` (default) for summaries, `github` for native GitHub -# coverage, or `codecov`. Both publishers consume validated Cobertura. Native -# GitHub coverage requires repository enablement and a default-branch baseline. -# The reporting workflow owns one CI comment and the `CI reports complete` check. -# Forks retain diagnostics without write operations. Partial reruns require -# rerunning all producers. Producer workflows test the PR head or push revision. -# -# Standalone action jobs forward their `report-plan` output. Custom outer matrices -# must forward a complete plan derived from their configuration; GitHub's last -# successful matrix output does not describe all executions. See the common -# [recording action](https://github.com/hoverkraft-tech/ci-github-common/tree/main/actions/quality/record-ci-reports) -# for the advanced contract. No collector-side coverage inventory is needed. +# Call ci-github-common's ci-reports.yml once after all producer jobs with +# job-results: toJSON(needs). No report plans or artifact IDs need forwarding. +# Producer calls need actions: read and contents: read. The reporting caller grants +# actions: read, contents: read, pull-requests: write, code-quality: write, +# id-token: write and security-events: write; internal publisher jobs narrow these. +# Lint and test results default to annotations. Coverage defaults to GitHub when +# available, then a comment or summary. Choose destinations using lint-reporters, +# test-results-reporters and test-coverage-reporters on that single reporting call. # name: Python Continuous Integration "on": @@ -132,15 +103,19 @@ name: Python Continuous Integration type: string default: . python-versions: - description: JSON array of Python versions. The last entry runs lint, audit and package checks and contributes coverage. Empty runs project detection once. An empty entry uses the project version. + description: + JSON array of Python versions. The highest configured version runs lint, audit, package checks and coverage; every version retains + test results. Empty uses project detection once. type: string default: "" lint: - description: true for default checks, a trusted Bash command, or a JSON object with command. false, null or empty disables lint. + description: true for defaults, a Bash command, or JSON options (command, lint-results). false, null or empty disables lint. type: string default: "true" test: - description: "true for defaults, a Bash command, or JSON options (command, coverage, coverage-reports). false, null or empty disables tests. Coverage is collected once, on the primary runtime." + description: + true for defaults, a Bash command, or JSON options (command, coverage, test-results, test-coverage). false, null or empty disables + tests. type: string default: "true" audit: @@ -152,21 +127,15 @@ name: Python Continuous Integration type: boolean default: true package: - description: false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. Does not publish packages. + description: + false disables distribution tests. true builds and installs wheel and sdist. A JSON object with tests supplies consumer smoke commands. + Does not publish packages. type: string default: "false" uv-version: description: Pinned uv release. type: string default: 0.13.9 - report-plan: - description: Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. - default: "" - type: string - outputs: - report-plan: - description: Complete expected report plan, consumed automatically by ci-reports. - value: ${{ jobs.configuration.outputs.report-plan }} permissions: {} jobs: configuration: @@ -179,8 +148,6 @@ jobs: test: ${{ steps.config.outputs.test }} package-enabled: ${{ steps.config.outputs.package-enabled }} package-tests: ${{ steps.config.outputs.package-tests }} - report-plan: ${{ steps.report-plan.outputs.report-plan }} - report-selections: ${{ steps.report-plan.outputs.selections }} steps: - id: config uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -215,8 +182,8 @@ jobs: } return config; } - const lint = options('lint', process.env.LINT, {command: ''}); - const test = options('test', process.env.TEST, {"command": "uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml", "coverage": true, "coverage-reports": []}); + const lint = options('lint', process.env.LINT, {command: '', 'lint-results': 'ruff.sarif'}); + const test = options('test', process.env.TEST, {command: '', coverage: true, 'test-results': 'junit.xml', 'test-coverage': 'coverage.xml'}); let pkg; try { pkg = JSON.parse(process.env.PACKAGE.trim() || 'false'); } catch { throw new Error('package must be true, false or an object with tests.'); } @@ -228,31 +195,25 @@ jobs: core.setOutput('package-enabled', enabled); core.setOutput('package-tests', pkg.tests || ''); core.setOutput('versions', versions); - core.setOutput('primary-version', versions.at(-1)); + if (versions.length > 1 && versions.includes('')) throw new Error('Project detection cannot be mixed with explicit versions.'); + const primary = [...versions].sort((a, b) => { + const left = a.split('.').map(Number); const right = b.split('.').map(Number); + for (let index = 0; index < 3; index++) { + const difference = (left[index] || 0) - (right[index] || 0); + if (difference) return difference; + } + return 0; + }).at(-1); + core.setOutput('primary-version', primary); core.setOutput('lint', JSON.stringify(lint)); core.setOutput('test', JSON.stringify(test)); - - const directory = process.env.DIRECTORY || '.'; - const producers = []; - if (process.env.CHECKS === 'true' && lint) producers.push({key:'lint',type:'lint',directory,coverage:[]}); - if (process.env.CHECKS === 'true' && test) for (const version of versions) { - producers.push({key:'test-'+(version || 'project'),type:'test',directory, - coverage:version === versions.at(-1) && test.coverage ? (test['coverage-reports'].length ? test['coverage-reports'] : [{file:'cobertura.xml',language:'Python'}]) : []}); - } - core.setOutput('report-producers', producers); - - id: report-plan - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) - with: - operation: plan - producers: ${{ steps.config.outputs.report-producers }} - report-plan: ${{ inputs.report-plan }} dependency-review: if: inputs.checks && inputs.dependency-review && github.event_name == 'pull_request' runs-on: ${{ fromJSON(inputs.runs-on) }} permissions: contents: read steps: - - &checkout + - &id001 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -265,9 +226,10 @@ jobs: timeout-minutes: 20 permissions: contents: read + actions: read steps: - - *checkout - - &setup-primary + - *id001 + - &id002 uses: $/actions/setup-python with: working-directory: ${{ inputs.working-directory }} @@ -277,7 +239,7 @@ jobs: with: working-directory: ${{ inputs.working-directory }} command: ${{ fromJSON(needs.configuration.outputs.lint).command }} - report-plan: ${{ toJSON(fromJSON(needs.configuration.outputs.report-selections).lint) }} + lint-results: ${{ fromJSON(needs.configuration.outputs.lint).lint-results }} test: if: inputs.checks && needs.configuration.outputs.test != 'null' needs: configuration @@ -285,6 +247,7 @@ jobs: timeout-minutes: 20 permissions: contents: read + actions: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -299,9 +262,11 @@ jobs: with: working-directory: ${{ inputs.working-directory }} command: ${{ fromJSON(needs.configuration.outputs.test).command }} - coverage-reports: ${{ fromJSON(needs.configuration.outputs.test).coverage-reports[0] && toJSON(fromJSON(needs.configuration.outputs.test).coverage-reports) || '' }} - coverage: ${{ matrix.version == needs.configuration.outputs.primary-version && fromJSON(needs.configuration.outputs.test).coverage && 'true' || 'false' }} - report-plan: ${{ toJSON(fromJSON(needs.configuration.outputs.report-selections)[format('test-{0}', matrix.version || 'project')]) }} + coverage: + ${{ matrix.version == needs.configuration.outputs.primary-version && fromJSON(needs.configuration.outputs.test).coverage && 'true' || + 'false' }} + test-results: ${{ fromJSON(needs.configuration.outputs.test).test-results }} + test-coverage: ${{ fromJSON(needs.configuration.outputs.test).test-coverage }} strategy: fail-fast: false matrix: @@ -314,8 +279,8 @@ jobs: permissions: contents: read steps: - - *checkout - - *setup-primary + - *id001 + - *id002 - uses: $/actions/audit with: working-directory: ${{ inputs.working-directory }} @@ -327,8 +292,8 @@ jobs: permissions: contents: read steps: - - *checkout - - *setup-primary + - *id001 + - *id002 - uses: $/actions/package/test with: working-directory: ${{ inputs.working-directory }} diff --git a/actions/lint/README.md b/actions/lint/README.md index a32cea6..8e55987 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -23,22 +23,15 @@ ## Overview -Run project-locked Ruff, Black and mypy. +Check Python using project-locked Ruff, Black and mypy. -Declare all three in the default uv dependency groups and configure them in -`pyproject.toml`. Ruff emits SARIF, Black checks formatting and mypy checks types. -All three execute even after one fails. A trusted Bash `command` replaces defaults; -emit SARIF or Checkstyle to retain annotations from custom checks. +Run setup-python first and declare these tools in the default uv dependency groups. +All checks execute even when another fails. Ruff writes SARIF into a fresh +report directory. Custom commands receive CI_REPORTS_DIR. - - - -Run [setup-python](../setup-python/README.md) first with the same `working-directory`. - -Native reports survive command failures and are retained for seven days. -See the [continuous integration workflow](../../.github/workflows/continuous-integration.md#reports-and-permissions) for consolidated reporting and permissions. - - +Native diagnostics are registered before execution and validated after failures +as well as success. The common ci-reports workflow publishes the final feedback. +Producer jobs require actions: read and contents: read. @@ -50,17 +43,18 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@ea81a685d9e862c5f13215d8b95476a4c0aa70d8 # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/lint@aac96a4977a2025432625385dd73aeeebb7af64a # feat/native-github-coverage with: # uv project directory. # Default: `.` working-directory: . - # Trusted Bash command replacing the default checks. Generate SARIF or Checkstyle reports for annotations. + # Trusted Bash replacement for Ruff, Black and mypy. Write the declared reports under CI_REPORTS_DIR. command: "" - # Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. - report-plan: "" + # Required lint report paths relative to CI_REPORTS_DIR, one per line. + # Default: `ruff.sarif` + lint-results: ruff.sarif ``` @@ -69,11 +63,11 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| ----------------------- | -------------------------------------------------------------------------------------------------------- | ------------ | ----------- | -| **`working-directory`** | uv project directory. | **false** | `.` | -| **`command`** | Trusted Bash command replacing the default checks. Generate SARIF or Checkstyle reports for annotations. | **false** | - | -| **`report-plan`** | Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. | **false** | - | +| **Input** | **Description** | **Required** | **Default** | +| ----------------------- | --------------------------------------------------------------------------------------------------- | ------------ | ------------ | +| **`working-directory`** | uv project directory. | **false** | `.` | +| **`command`** | Trusted Bash replacement for Ruff, Black and mypy. Write the declared reports under CI_REPORTS_DIR. | **false** | - | +| **`lint-results`** | Required lint report paths relative to CI_REPORTS_DIR, one per line. | **false** | `ruff.sarif` | @@ -84,10 +78,9 @@ See the [continuous integration workflow](../../.github/workflows/continuous-int ## Outputs -| **Output** | **Description** | -| ------------------------ | ------------------------------------------------------------ | -| **`report-plan`** | Expected lint report metadata. Forward from standalone jobs. | -| **`report-artifact-id`** | Native lint report bundle. | +| **Output** | **Description** | +| ------------------------ | -------------------------- | +| **`report-artifact-id`** | Native lint report bundle. | diff --git a/actions/lint/action.yml b/actions/lint/action.yml index d328919..1341488 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -1,22 +1,14 @@ ---- name: Lint Python description: | - Run project-locked Ruff, Black and mypy. + Check Python using project-locked Ruff, Black and mypy. - Declare all three in the default uv dependency groups and configure them in - `pyproject.toml`. Ruff emits SARIF, Black checks formatting and mypy checks types. - All three execute even after one fails. A trusted Bash `command` replaces defaults; - emit SARIF or Checkstyle to retain annotations from custom checks. + Run setup-python first and declare these tools in the default uv dependency groups. + All checks execute even when another fails. Ruff writes SARIF into a fresh + report directory. Custom commands receive CI_REPORTS_DIR. - - - - Run [setup-python](../setup-python/README.md) first with the same `working-directory`. - - Native reports survive command failures and are retained for seven days. - See the [continuous integration workflow](../../.github/workflows/continuous-integration.md#reports-and-permissions) for consolidated reporting and permissions. - - + Native diagnostics are registered before execution and validated after failures + as well as success. The common ci-reports workflow publishes the final feedback. + Producer jobs require actions: read and contents: read. author: hoverkraft branding: icon: package @@ -26,15 +18,12 @@ inputs: description: uv project directory. default: . command: - description: Trusted Bash command replacing the default checks. Generate SARIF or Checkstyle reports for annotations. - default: "" - report-plan: - description: Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. + description: Trusted Bash replacement for Ruff, Black and mypy. Write the declared reports under CI_REPORTS_DIR. default: "" + lint-results: + description: Required lint report paths relative to CI_REPORTS_DIR, one per line. + default: ruff.sarif outputs: - report-plan: - description: Expected lint report metadata. Forward from standalone jobs. - value: ${{ steps.report-plan.outputs.report-plan }} report-artifact-id: description: Native lint report bundle. value: ${{ steps.reports.outputs.artifact-id }} @@ -45,18 +34,34 @@ runs: uses: hoverkraft-tech/ci-github-common/actions/working-directory@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 with: working-directory: ${{ inputs.working-directory }} - - id: report-plan - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) + - id: definition + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + DIRECTORY: ${{ steps.directory.outputs.workspace-relative-path || '.' }} + WORKING_DIRECTORY: ${{ steps.directory.outputs.absolute-path }} + LINT_RESULTS: ${{ inputs.lint-results }} + with: + script: | + const paths = value => { + const result = value.split(/\r?\n/).map(item => item.trim()).filter(Boolean); + if (!result.length) throw new Error('Required report paths must not be empty.'); + return result; + }; + const reports = paths(process.env.LINT_RESULTS).map(pattern => ({kind: 'lint', pattern})); + const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); + core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); + - id: prepare + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) with: - operation: plan - report-plan: ${{ inputs.report-plan }} - producers: '[{"key":"lint","type":"lint","directory":${{ toJSON(steps.directory.outputs.workspace-relative-path || ''.'') }},"coverage":[]}]' + operation: prepare + definition: ${{ steps.definition.outputs.definition }} - id: run shell: bash working-directory: ${{ steps.directory.outputs.absolute-path }} env: COMMAND: ${{ inputs.command }} CI: "true" + CI_REPORTS_DIR: ${{ steps.prepare.outputs.report-directory }} run: | if [ -n "$COMMAND" ] && ! [[ "$COMMAND" =~ [^[:space:]] ]]; then echo "command must not contain only whitespace." >&2 @@ -67,15 +72,15 @@ runs: exit fi status=0 - uv run --locked ruff check --output-format=sarif --output-file=ruff.sarif . || status=1 + uv run --locked ruff check --output-format=sarif --output-file="$CI_REPORTS_DIR/ruff.sarif" . || status=1 uv run --locked black --check . || status=1 uv run --locked mypy . || status=1 exit "$status" - id: reports - name: Record lint results - if: ${{ !cancelled() && steps.run.outcome != 'skipped' && steps.report-plan.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) + name: Validate and retain native reports + if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) with: - working-directory: ${{ steps.directory.outputs.absolute-path }} - report-plan: ${{ steps.report-plan.outputs.report-plan }} - report-paths: auto:lint + operation: finalize + recording: ${{ steps.prepare.outputs.recording }} + outcome: ${{ steps.run.outcome }} diff --git a/actions/test/README.md b/actions/test/README.md index 3c5b4ea..01e0715 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -23,15 +23,16 @@ ## Overview -Run Python tests and retain native test and coverage reports. +Run pytest with detailed test results on every runtime and optional coverage. -Use the matching setup action first. Commands must generate JUnit reports. -Coverage collection requires Cobertura XML. The test command controls instrumentation. +Run setup-python first. Default commands write JUnit and coverage.py XML into a +fresh directory. Configure measured packages in [tool.coverage.run]. +Custom commands receive CI_REPORTS_DIR and CI_TEST_COVERAGE. -Forward report-plan from standalone jobs, or use the reusable CI workflow, which -exposes the complete expected plan automatically. Choose external coverage -publication once in the common ci-reports workflow. This action posts no comments -and needs no publication permissions. Available reports survive test failures. +Reports are registered before execution and validated afterward, including after +command failure. Missing or malformed required reports fail the action. Call +the common ci-reports workflow once after all checks; no report outputs need forwarding. +Producer jobs require actions: read and contents: read. @@ -43,26 +44,26 @@ and needs no publication permissions. Available reports survive test failures. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@ea81a685d9e862c5f13215d8b95476a4c0aa70d8 # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/test@aac96a4977a2025432625385dd73aeeebb7af64a # feat/native-github-coverage with: # uv project directory. # Default: `.` working-directory: . - # Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. - # Default: `uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml` - command: uv run --locked pytest --junitxml=junit.xml --cov - --cov-report=term-missing --cov-report=xml:cobertura.xml + # Trusted Bash command replacing pytest. Write reports under CI_REPORTS_DIR and honor CI_TEST_COVERAGE for instrumentation. + command: "" - # Optional JSON array of Cobertura file, language and label. Empty uses cobertura.xml and the project directory as its stable label. - coverage-reports: "" - - # Require and collect Cobertura coverage. Set false to retain only available native diagnostics. Instrumentation is controlled by the test command. + # Collect test coverage. The default pytest command disables instrumentation when false. # Default: `true` coverage: "true" - # Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. - report-plan: "" + # Required JUnit or TAP paths relative to CI_REPORTS_DIR, one per line. + # Default: `junit.xml` + test-results: junit.xml + + # Required native coverage paths relative to CI_REPORTS_DIR when coverage is enabled, one per line. + # Default: `coverage.xml` + test-coverage: coverage.xml ``` @@ -71,13 +72,13 @@ and needs no publication permissions. Available reports survive test failures. ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------ | -| **`working-directory`** | uv project directory. | **false** | `.` | -| **`command`** | Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. | **false** | `uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml` | -| **`coverage-reports`** | Optional JSON array of Cobertura file, language and label. Empty uses cobertura.xml and the project directory as its stable label. | **false** | - | -| **`coverage`** | Require and collect Cobertura coverage. Set false to retain only available native diagnostics. Instrumentation is controlled by the test command. | **false** | `true` | -| **`report-plan`** | Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. | **false** | - | +| **Input** | **Description** | **Required** | **Default** | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------- | +| **`working-directory`** | uv project directory. | **false** | `.` | +| **`command`** | Trusted Bash command replacing pytest. Write reports under CI_REPORTS_DIR and honor CI_TEST_COVERAGE for instrumentation. | **false** | - | +| **`coverage`** | Collect test coverage. The default pytest command disables instrumentation when false. | **false** | `true` | +| **`test-results`** | Required JUnit or TAP paths relative to CI_REPORTS_DIR, one per line. | **false** | `junit.xml` | +| **`test-coverage`** | Required native coverage paths relative to CI_REPORTS_DIR when coverage is enabled, one per line. | **false** | `coverage.xml` | @@ -90,7 +91,6 @@ and needs no publication permissions. Available reports survive test failures. | **Output** | **Description** | | ------------------------ | --------------------------------------------------------------------- | -| **`report-plan`** | Expected report metadata. Forward from standalone jobs. | | **`report-artifact-id`** | Native report bundle, including available diagnostics after failures. | diff --git a/actions/test/action.test.cjs b/actions/test/action.test.cjs index 2ca357f..5b8573d 100644 --- a/actions/test/action.test.cjs +++ b/actions/test/action.test.cjs @@ -42,3 +42,29 @@ test("test configuration rejects non-boolean coverage configuration", (t) => { 0, ); }); + +test("the default command writes into the fresh directory and disables coverage on secondary runtimes", (t) => { + const directory = createWorkspace(t); + const log = path.join(directory, "arguments.json"); + fs.writeFileSync( + path.join(directory, "uv"), + `#!/usr/bin/env node +require("node:fs").writeFileSync(process.env.ARGUMENT_LOG, JSON.stringify(process.argv.slice(2))); +`, + { mode: 0o700 }, + ); + for (const coverage of ["true", "false"]) { + const result = runActionStep(actionFile, "run", directory, { + COMMAND: "", + CI_TEST_COVERAGE: coverage, + CI_REPORTS_DIR: path.join(directory, "fresh reports"), + PATH: `${directory}:${process.env.PATH}`, + ARGUMENT_LOG: log, + }); + assert.equal(result.status, 0, result.stderr); + const args = JSON.parse(fs.readFileSync(log, "utf8")); + assert.ok(args.includes(`--junitxml=${directory}/fresh reports/junit.xml`)); + assert.equal(args.includes("--no-cov"), coverage === "false"); + assert.equal(args.includes("--cov"), coverage === "true"); + } +}); diff --git a/actions/test/action.yml b/actions/test/action.yml index b5f281d..fcf8c66 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -1,15 +1,15 @@ ---- name: Test Python description: | - Run Python tests and retain native test and coverage reports. + Run pytest with detailed test results on every runtime and optional coverage. - Use the matching setup action first. Commands must generate JUnit reports. - Coverage collection requires Cobertura XML. The test command controls instrumentation. + Run setup-python first. Default commands write JUnit and coverage.py XML into a + fresh directory. Configure measured packages in [tool.coverage.run]. + Custom commands receive CI_REPORTS_DIR and CI_TEST_COVERAGE. - Forward report-plan from standalone jobs, or use the reusable CI workflow, which - exposes the complete expected plan automatically. Choose external coverage - publication once in the common ci-reports workflow. This action posts no comments - and needs no publication permissions. Available reports survive test failures. + Reports are registered before execution and validated afterward, including after + command failure. Missing or malformed required reports fail the action. Call + the common ci-reports workflow once after all checks; no report outputs need forwarding. + Producer jobs require actions: read and contents: read. author: hoverkraft branding: icon: package @@ -19,22 +19,18 @@ inputs: description: uv project directory. default: . command: - description: Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. - default: uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml - coverage-reports: - description: |- - Optional JSON array of Cobertura file, language and label. Empty uses cobertura.xml and the project directory as its stable label. + description: Trusted Bash command replacing pytest. Write reports under CI_REPORTS_DIR and honor CI_TEST_COVERAGE for instrumentation. default: "" coverage: - description: Require and collect Cobertura coverage. Set false to retain only available native diagnostics. Instrumentation is controlled by the test command. + description: Collect test coverage. The default pytest command disables instrumentation when false. default: "true" - report-plan: - description: Expected producer metadata supplied by reusable workflows. Leave empty for a standalone invocation. - default: "" + test-results: + description: Required JUnit or TAP paths relative to CI_REPORTS_DIR, one per line. + default: junit.xml + test-coverage: + description: Required native coverage paths relative to CI_REPORTS_DIR when coverage is enabled, one per line. + default: coverage.xml outputs: - report-plan: - description: Expected report metadata. Forward from standalone jobs. - value: ${{ steps.report-plan.outputs.report-plan }} report-artifact-id: description: Native report bundle, including available diagnostics after failures. value: ${{ steps.reports.outputs.artifact-id }} @@ -50,31 +46,61 @@ runs: env: COVERAGE: ${{ inputs.coverage }} run: | - case "$COVERAGE" in true|false) ;; *) echo 'coverage must be true or false.' >&2; exit 1 ;; esac - - id: report-plan - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) + case "$COVERAGE" in true|false) ;; *) echo "coverage must be true or false." >&2; exit 1 ;; esac + - id: definition + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + DIRECTORY: ${{ steps.directory.outputs.workspace-relative-path || '.' }} + WORKING_DIRECTORY: ${{ steps.directory.outputs.absolute-path }} + TEST_RESULTS: ${{ inputs.test-results }} + TEST_COVERAGE: ${{ inputs.test-coverage }} + COVERAGE: ${{ inputs.coverage }} with: - operation: plan - report-plan: ${{ inputs.report-plan }} - producers: '[{"key":"test","type":"test","directory":${{ toJSON(steps.directory.outputs.workspace-relative-path || ''.'') }},"coverage":${{ inputs.coverage == ''true'' && (inputs.coverage-reports || ''[{"file":"cobertura.xml","language":"Python"}]'') || ''[]'' }}}]' + script: | + const paths = value => { + const result = value.split(/\r?\n/).map(item => item.trim()).filter(Boolean); + if (!result.length) throw new Error('Required report paths must not be empty.'); + return result; + }; + const reports = paths(process.env.TEST_RESULTS).map(pattern => ({kind: 'test', pattern})); + if (process.env.COVERAGE === 'true') reports.push(...paths(process.env.TEST_COVERAGE).map(pattern => ({kind: 'coverage', pattern, language: 'Python'}))); + const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); + core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); + - id: prepare + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + with: + operation: prepare + definition: ${{ steps.definition.outputs.definition }} - id: run shell: bash working-directory: ${{ steps.directory.outputs.absolute-path }} env: COMMAND: ${{ inputs.command }} CI: "true" + CI_REPORTS_DIR: ${{ steps.prepare.outputs.report-directory }} + CI_TEST_COVERAGE: ${{ inputs.coverage }} + COVERAGE_FILE: ${{ steps.prepare.outputs.report-directory }}/.coverage run: | - test -n "$COMMAND" || { echo "command must not be empty." >&2; exit 1; } if [ -n "$COMMAND" ] && ! [[ "$COMMAND" =~ [^[:space:]] ]]; then echo "command must not contain only whitespace." >&2 exit 1 fi - bash --noprofile --norc -e -u -o pipefail -c "$COMMAND" - - name: Record test results - id: reports - if: ${{ !cancelled() && steps.run.outcome != 'skipped' && steps.report-plan.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@11c842902d003cc4ee2fa1d42f6d80bc6828461a # unified reports (PR #683, unreleased) + if [ -n "$COMMAND" ]; then + bash --noprofile --norc -e -u -o pipefail -c "$COMMAND" + exit + fi + args=(--junitxml="$CI_REPORTS_DIR/junit.xml") + if [ "$CI_TEST_COVERAGE" = true ]; then + args+=(--cov --cov-report=term-missing --cov-report="xml:$CI_REPORTS_DIR/coverage.xml") + else + args+=(--no-cov) + fi + uv run --locked pytest "${args[@]}" + - id: reports + name: Validate and retain native reports + if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) with: - working-directory: ${{ steps.directory.outputs.absolute-path }} - report-plan: ${{ steps.report-plan.outputs.report-plan }} - report-paths: auto:test + operation: finalize + recording: ${{ steps.prepare.outputs.recording }} + outcome: ${{ steps.run.outcome }} diff --git a/tests/config.test.cjs b/tests/config.test.cjs index 3b52f05..f7579d1 100644 --- a/tests/config.test.cjs +++ b/tests/config.test.cjs @@ -31,16 +31,17 @@ async function parse(env = {}) { return outputs; } -test("uses project detection by default and the last explicit version as primary", async () => { +test("uses project detection by default and the highest explicit version as primary", async () => { const automatic = await parse(); assert.deepEqual(automatic.versions, [""]); assert.equal(automatic["primary-version"], ""); - const explicit = await parse({ VERSIONS: '["3.13", "3.15"]' }); - assert.equal(explicit["primary-version"], explicit.versions.at(-1)); + const explicit = await parse({ VERSIONS: '["3.15", "3.13"]' }); + assert.equal(explicit["primary-version"], "3.15"); }); test("rejects ambiguous or unbounded version matrices", async () => { for (const value of [ + '["", "3.15"]', "[]", '["1.2", "1.2"]', "[1.2]", @@ -114,12 +115,11 @@ test("distribution checks are opt-in and validate consumer commands", async () = } }); -test("preserves native coverage configuration and rejects ambiguous input types", async () => { +test("preserves declared native reports and rejects ambiguous input types", async () => { const options = { coverage: true, - "coverage-reports": [ - { file: "custom.xml", language: "Python", label: "backend" }, - ], + "test-results": "junit.xml", + "test-coverage": "native.xml", }; const actual = JSON.parse( (await parse({ TEST: JSON.stringify(options) })).test, @@ -127,8 +127,8 @@ test("preserves native coverage configuration and rejects ambiguous input types" for (const [key, value] of Object.entries(options)) assert.deepEqual(actual[key], value); for (const invalid of [ - { "coverage-reports": {} }, - { "report-group": "bad/group" }, + { "test-coverage": {} }, + { "report-plan": "obsolete" }, ]) { await assert.rejects(() => parse({ TEST: JSON.stringify(invalid) })); } From 125528263bb2123d4052de5446d291fdefc496bc Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 01:36:14 +0100 Subject: [PATCH 07/28] test(reports): collect fixture coverage only in the runtime matrix --- .github/workflows/__test-action-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 7165a2e..1c1925a 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -32,6 +32,7 @@ jobs: uses: $/actions/test with: working-directory: tests/python-project + coverage: "false" name: Act - Run default tests verify: needs: test From 9fd89e7cd47a96f49ae5e3468a6abc5dfc2f4add Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 17:08:07 +0100 Subject: [PATCH 08/28] refactor: consolidate native reports and require an independent CI gate --- .github/workflows/__shared-ci.yml | 40 ++++++++++++++----- .github/workflows/__test-action-lint.yml | 11 ++--- .../workflows/__test-action-setup-python.yml | 8 ++-- .github/workflows/__test-action-test.yml | 11 ++--- ...__test-workflow-continuous-integration.yml | 12 +++--- actions/lint/README.md | 2 +- actions/lint/action.yml | 4 +- actions/test/README.md | 2 +- actions/test/action.yml | 4 +- docs/development/README.md | 16 +++++--- package.json | 3 +- 11 files changed, 72 insertions(+), 41 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 294fde3..6021cbb 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,14 +4,14 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) permissions: + actions: read contents: read statuses: write issues: write packages: read pull-requests: write - actions: read security-events: write with: linter-env: | @@ -24,36 +24,37 @@ jobs: test: uses: $/.github/workflows/__test-workflow-continuous-integration.yml permissions: + actions: read contents: read id-token: write - actions: read test-action-setup-python: uses: $/.github/workflows/__test-action-setup-python.yml permissions: - contents: read actions: read + contents: read test-action-lint: uses: $/.github/workflows/__test-action-lint.yml permissions: - contents: read actions: read + contents: read test-action-test: uses: $/.github/workflows/__test-action-test.yml permissions: - contents: read actions: read + contents: read test-action-audit: uses: $/.github/workflows/__test-action-audit.yml permissions: - contents: read actions: read + contents: read test-action-package-test: uses: $/.github/workflows/__test-action-package-test.yml permissions: - contents: read actions: read + contents: read + reports: - if: ${{ !cancelled() }} + if: always() needs: - linter - test @@ -62,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) permissions: actions: read contents: read @@ -72,3 +73,22 @@ jobs: security-events: write with: job-results: ${{ toJSON(needs) }} + + complete: + name: CI complete + if: always() + needs: + - linter + - test + - test-action-setup-python + - test-action-lint + - test-action-test + - test-action-audit + - test-action-package-test + - reports + runs-on: ubuntu-latest + permissions: {} + steps: + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + with: + job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index be10c2e..8853744 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -7,8 +7,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 permissions: - contents: read actions: read + contents: read outputs: artifact-id: ${{ steps.check.outputs.report-artifact-id }} steps: @@ -18,12 +18,13 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info command: test:ci arguments: '["actions/lint/action.test.cjs"]' - coverage: none - comment: "false" + coverage: "false" - name: Arrange - Install the project runtime and dependencies uses: $/actions/setup-python with: @@ -38,8 +39,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 permissions: - contents: read actions: read + contents: read steps: - name: Assert - Download retained lint reports uses: hoverkraft-tech/ci-github-common/actions/download-artifact@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index 4781b7d..3744e42 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -7,6 +7,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 permissions: + actions: read contents: read steps: - name: Arrange - Check out the repository @@ -15,12 +16,13 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info command: test:ci arguments: '["actions/setup-python/action.test.cjs"]' - coverage: none - comment: "false" + coverage: "false" - name: Act - Detect the runtime and install dependencies uses: $/actions/setup-python with: diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 1c1925a..3891662 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -7,8 +7,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 permissions: - contents: read actions: read + contents: read outputs: artifact-id: ${{ steps.check.outputs.report-artifact-id }} steps: @@ -18,12 +18,13 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info command: test:ci arguments: '["actions/test/action.test.cjs"]' - coverage: none - comment: "false" + coverage: "false" - uses: $/actions/setup-python with: working-directory: tests/python-project @@ -39,8 +40,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 permissions: - contents: read actions: read + contents: read steps: - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@af0bdd6313bd49aaf4a8a7f0de005fb0db856b03 # 4.3.3 with: diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 9f0ec8c..a812d07 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -6,6 +6,7 @@ jobs: configuration: runs-on: ubuntu-latest permissions: + actions: read contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -13,18 +14,19 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@191d7230d57982bfc11d57f68b005f386a6d7fbf # 3.1.1 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info command: test:ci arguments: '["tests/config.test.cjs"]' - coverage: none - comment: "false" + coverage: "true" fixture: uses: $/.github/workflows/continuous-integration.yml permissions: + actions: read contents: read id-token: write - actions: read with: working-directory: tests/python-project test: '{"coverage":true}' @@ -34,9 +36,9 @@ jobs: checks-disabled: uses: $/.github/workflows/continuous-integration.yml permissions: + actions: read contents: read id-token: write - actions: read with: checks: false working-directory: must-not-exist diff --git a/actions/lint/README.md b/actions/lint/README.md index 8e55987..7af8218 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -43,7 +43,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@aac96a4977a2025432625385dd73aeeebb7af64a # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/lint@125528263bb2123d4052de5446d291fdefc496bc # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 1341488..ea31e4f 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/README.md b/actions/test/README.md index 01e0715..97a3e65 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -44,7 +44,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@aac96a4977a2025432625385dd73aeeebb7af64a # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/test@125528263bb2123d4052de5446d291fdefc496bc # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/test/action.yml b/actions/test/action.yml index fcf8c66..5379ea8 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@ea5900049a1704d6d2b479cc6cce37e799f532a3 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/docs/development/README.md b/docs/development/README.md index 2a9dd43..ee984b1 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -2,9 +2,8 @@ Install Node.js from `.node-version`, npm, uv and a supported Python runtime, and Docker. Node.js and the development-only `yaml` dependency exercise the actual inline -Actions configuration scripts. Lint and test actions share the internal -[parse-ci-reports action](../../.github/actions/parse-ci-reports/README.md), which owns -file selection, unique artifact naming and uploads. +Actions configuration scripts. Lint and test actions use common `record-ci-reports` for fresh-file validation, +execution identity and retention. Native parsers and publication live only in common. ```sh make setup @@ -43,8 +42,7 @@ The Node tests execute workflow configuration directly to check matrix selection disable switches and invalid input. Action contract tests live beside each action as `action.test.cjs`, including [setup](../../actions/setup-python/action.test.cjs), -[lint](../../actions/lint/action.test.cjs), [test](../../actions/test/action.test.cjs) -and [report parsing](../../.github/actions/parse-ci-reports/action.test.cjs). +[lint](../../actions/lint/action.test.cjs) and [test](../../actions/test/action.test.cjs). They execute the actual Bash and JavaScript from adjacent action metadata to check quoting, failure propagation, setup preconditions and artifact selection. `make test` discovers these files and the workflow configuration tests. @@ -111,3 +109,11 @@ Markdown validation. Super-Linter reads the fixture's `pyproject.toml` for Black, Ruff, isort and mypy. It uses the same first-party import classification as project-local checks. + +## Reporting boundary + +One outer `ci-reports` job publishes all evidence. A separate required `CI complete` +job checks every producer and reporting with `check-jobs`. Failed native tests +fail the producer, while valid reports can still be published successfully. +Unexpected skips fail the gate. Configure explicitly allowed conditional skips +in the caller; the reporting workflow owns no skip policy. diff --git a/package.json b/package.json index ba694cf..eb5cfb5 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,7 @@ "description": "Development-only tests for GitHub Actions configuration", "scripts": { "test": "node --test tests/*.test.cjs actions/*/*.test.cjs", - "test:ci": "node --test --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=coverage/junit.xml", - "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', {recursive:true})\"" + "test:ci": "node $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\"" }, "devDependencies": { "yaml": "2.9.1" From b69da479c0fb6542025f5eb845f7b3b8790dc30b Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 17:18:26 +0100 Subject: [PATCH 09/28] fix: retain contract results without empty coverage measurements --- .github/workflows/__shared-ci.yml | 1 + .github/workflows/__test-workflow-continuous-integration.yml | 2 +- docs/development/README.md | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 6021cbb..91508a5 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -87,6 +87,7 @@ jobs: - test-action-package-test - reports runs-on: ubuntu-latest + timeout-minutes: 5 permissions: {} steps: - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index a812d07..db2d69a 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -20,7 +20,7 @@ jobs: test-coverage: lcov.info command: test:ci arguments: '["tests/config.test.cjs"]' - coverage: "true" + coverage: "false" fixture: uses: $/.github/workflows/continuous-integration.yml permissions: diff --git a/docs/development/README.md b/docs/development/README.md index ee984b1..27bd7b5 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -117,3 +117,7 @@ job checks every producer and reporting with `check-jobs`. Failed native tests fail the producer, while valid reports can still be published successfully. Unexpected skips fail the gate. Configure explicitly allowed conditional skips in the caller; the reporting workflow owns no skip policy. + +The Node contract suites execute inline workflow scripts; they retain JUnit results +without requesting an empty JavaScript coverage measurement. The language fixture +collects application coverage on its primary runtime. From 060a155db66a515251c843ed7b72d90431b58029 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 17:25:37 +0100 Subject: [PATCH 10/28] fix: use validated common reporting contracts --- .github/workflows/__shared-ci.yml | 6 +++--- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 91508a5..45bf43a 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/actions/lint/action.yml b/actions/lint/action.yml index ea31e4f..0afb9f3 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 5379ea8..96f74f1 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@85351002dc2303c4a70233197edcadb20b1cb90e # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From d02e214f134c9f847b3ead602f03a510970629ed Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 18:06:29 +0100 Subject: [PATCH 11/28] ci: validate the final shared reporting contract --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__test-action-lint.yml | 2 +- .github/workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 2 +- .../workflows/__test-workflow-continuous-integration.yml | 2 +- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 45bf43a..31d2c4e 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index 8853744..5cb5215 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index 3744e42..0c792f7 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 3891662..6d8c94d 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index db2d69a..49c0c3b 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 0afb9f3..234333d 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 96f74f1..3d392e5 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From a997ce1ba700d46d40da534d336a77f30686c682 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 18:12:54 +0100 Subject: [PATCH 12/28] docs: preserve branding in generated action references --- .github/workflows/continuous-integration.md | 6 ++++++ actions/lint/README.md | 6 ++++++ actions/test/README.md | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/.github/workflows/continuous-integration.md b/.github/workflows/continuous-integration.md index b20a657..81f83ea 100644 --- a/.github/workflows/continuous-integration.md +++ b/.github/workflows/continuous-integration.md @@ -2,6 +2,12 @@ # GitHub Reusable Workflow: Python Continuous Integration +
+ Python Continuous Integration +
+ +--- + diff --git a/actions/lint/README.md b/actions/lint/README.md index 7af8218..15d0dfe 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -2,6 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItcGFja2FnZSIgY29sb3I9ImJsdWUiPjxsaW5lIHgxPSIxNi41IiB5MT0iOS40IiB4Mj0iNy41IiB5Mj0iNC4yMSI+PC9saW5lPjxwYXRoIGQ9Ik0yMSAxNlY4YTIgMiAwIDAgMC0xLTEuNzNsLTctNGEyIDIgMCAwIDAtMiAwbC03IDRBMiAyIDAgMCAwIDMgOHY4YTIgMiAwIDAgMCAxIDEuNzNsNyA0YTIgMiAwIDAgMCAyIDBsNy00QTIgMiAwIDAgMCAyMSAxNnoiPjwvcGF0aD48cG9seWxpbmUgcG9pbnRzPSIzLjI3IDYuOTYgMTIgMTIuMDEgMjAuNzMgNi45NiI+PC9wb2x5bGluZT48bGluZSB4MT0iMTIiIHkxPSIyMi4wOCIgeDI9IjEyIiB5Mj0iMTIiPjwvbGluZT48L3N2Zz4=) GitHub Action: Lint Python +
+ Lint Python +
+ +--- + diff --git a/actions/test/README.md b/actions/test/README.md index 97a3e65..9edb8e5 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -2,6 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItcGFja2FnZSIgY29sb3I9ImJsdWUiPjxsaW5lIHgxPSIxNi41IiB5MT0iOS40IiB4Mj0iNy41IiB5Mj0iNC4yMSI+PC9saW5lPjxwYXRoIGQ9Ik0yMSAxNlY4YTIgMiAwIDAgMC0xLTEuNzNsLTctNGEyIDIgMCAwIDAtMiAwbC03IDRBMiAyIDAgMCAwIDMgOHY4YTIgMiAwIDAgMCAxIDEuNzNsNyA0YTIgMiAwIDAgMCAyIDBsNy00QTIgMiAwIDAgMCAyMSAxNnoiPjwvcGF0aD48cG9seWxpbmUgcG9pbnRzPSIzLjI3IDYuOTYgMTIgMTIuMDEgMjAuNzMgNi45NiI+PC9wb2x5bGluZT48bGluZSB4MT0iMTIiIHkxPSIyMi4wOCIgeDI9IjEyIiB5Mj0iMTIiPjwvbGluZT48L3N2Zz4=) GitHub Action: Test Python +
+ Test Python +
+ +--- + From 7d19b9a1ef89f3b960cb59a692a9d60cca7902a2 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 09:46:22 +0100 Subject: [PATCH 13/28] fix(ci): adopt external coverage comment ownership --- .github/workflows/__shared-ci.yml | 6 +++--- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 31d2c4e..1104286 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 234333d..c3f42dc 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 3d392e5..b9e7fb5 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From 6ff61b6e10d0f76d4638d4c3c7211e0d06ade3d1 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 11:11:56 +0100 Subject: [PATCH 14/28] ci: adopt actionable reports and stable coverage project flags --- .github/workflows/__shared-ci.yml | 6 +++--- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 1104286..895082b 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/actions/lint/action.yml b/actions/lint/action.yml index c3f42dc..f2461f7 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index b9e7fb5..0533624 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From 4d3ab5da5370ea95111d72fe046ecdd8fe99bfbf Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 11:21:38 +0100 Subject: [PATCH 15/28] ci: update validated reporting implementation --- .github/workflows/__shared-ci.yml | 6 +++--- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 895082b..d60fda1 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/actions/lint/action.yml b/actions/lint/action.yml index f2461f7..53d5f6b 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 0533624..3d20f0b 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From cf5a2da65198da89154eee94be7e8525fc12b82e Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 19:21:11 +0100 Subject: [PATCH 16/28] ci: use the corrected Common reporting actions --- .github/workflows/__shared-ci.yml | 6 +++--- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index d60fda1..001ad89 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 53d5f6b..ee8ec4b 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 3d20f0b..7ec578d 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From 07283c746a6e2461a240b0328db9c5ad1d4636eb Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 19:21:12 +0100 Subject: [PATCH 17/28] docs: refresh reporting action references --- actions/lint/README.md | 2 +- actions/test/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/lint/README.md b/actions/lint/README.md index 15d0dfe..f7b61d7 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -49,7 +49,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@125528263bb2123d4052de5446d291fdefc496bc # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/lint@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 with: # uv project directory. # Default: `.` diff --git a/actions/test/README.md b/actions/test/README.md index 9edb8e5..95efbb8 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -50,7 +50,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@125528263bb2123d4052de5446d291fdefc496bc # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/test@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 with: # uv project directory. # Default: `.` From a4dccefbeef8b98d39959fb69386f625045f57ff Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 19:34:37 +0100 Subject: [PATCH 18/28] docs: pin generated examples to the reporting preview --- actions/lint/README.md | 2 +- actions/test/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/lint/README.md b/actions/lint/README.md index f7b61d7..be730ac 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -49,7 +49,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 +- uses: hoverkraft-tech/ci-github-python/actions/lint@07283c746a6e2461a240b0328db9c5ad1d4636eb with: # uv project directory. # Default: `.` diff --git a/actions/test/README.md b/actions/test/README.md index 95efbb8..e33f2d0 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -50,7 +50,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 +- uses: hoverkraft-tech/ci-github-python/actions/test@07283c746a6e2461a240b0328db9c5ad1d4636eb with: # uv project directory. # Default: `.` From 9d9d9d3b4630f74dd1ca801da74193c4ba1a943b Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 20:47:15 +0100 Subject: [PATCH 19/28] ci: use bundled Node.js coverage conversion --- .github/workflows/__shared-ci.yml | 6 +++--- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 001ad89..2b0d999 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/actions/lint/action.yml b/actions/lint/action.yml index ee8ec4b..de5cd02 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 7ec578d..8516249 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From 20e0f199c5b6f58b8bfd7462e9455cb59adeb9e4 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 12:13:46 +0100 Subject: [PATCH 20/28] ci: validate composed report actions --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__test-action-lint.yml | 2 +- .github/workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 2 +- .../workflows/__test-workflow-continuous-integration.yml | 2 +- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 2b0d999..74b1249 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index 5cb5215..f7934bc 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index 0c792f7..f11cfad 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 6d8c94d..0c8329a 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 49c0c3b..319919f 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/actions/lint/action.yml b/actions/lint/action.yml index de5cd02..7022a03 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 8516249..a977f6c 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From 4b13949c089f64c11d0f0b882dd92689a36de760 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 13:43:19 +0100 Subject: [PATCH 21/28] refactor(ci): adopt standalone report publication actions --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__test-action-lint.yml | 2 +- .github/workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 2 +- .../workflows/__test-workflow-continuous-integration.yml | 2 +- .github/workflows/continuous-integration.md | 4 ++-- .github/workflows/continuous-integration.yml | 2 +- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 74b1249..e225d9b 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index f7934bc..c6f72f2 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index f11cfad..6982f5b 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 0c8329a..ad1a5c3 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 319919f..a847225 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@7da271bac658d21bb41f11c262410c0f8d2b239b # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/continuous-integration.md b/.github/workflows/continuous-integration.md index 81f83ea..d387155 100644 --- a/.github/workflows/continuous-integration.md +++ b/.github/workflows/continuous-integration.md @@ -107,7 +107,7 @@ lint and coverage once. Default pytest commands disable coverage instrumentation on other versions. Custom commands receive CI_TEST_COVERAGE and CI_REPORTS_DIR. Outputs are validated by the test action, including after command failure. -Call ci-github-common's ci-reports.yml once after all producer jobs with +Call ci-github-common's publish-ci-reports.yml once after all producer jobs with job-results: toJSON(needs). No report plans or artifact IDs need forwarding. Producer calls need actions: read and contents: read. The reporting caller grants actions: read, contents: read, pull-requests: write, code-quality: write, @@ -139,7 +139,7 @@ on: permissions: {} jobs: continuous-integration: - uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@aac96a4977a2025432625385dd73aeeebb7af64a # feat/native-github-coverage + uses: hoverkraft-tech/ci-github-python/.github/workflows/continuous-integration.yml@9fe07ffb0ede25d9311ca9e3d8c82d1ce38e7d75 # 0.0.1 permissions: actions: read contents: read diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index cf20331..b265f9d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -77,7 +77,7 @@ # on other versions. Custom commands receive CI_TEST_COVERAGE and CI_REPORTS_DIR. # Outputs are validated by the test action, including after command failure. # -# Call ci-github-common's ci-reports.yml once after all producer jobs with +# Call ci-github-common's publish-ci-reports.yml once after all producer jobs with # job-results: toJSON(needs). No report plans or artifact IDs need forwarding. # Producer calls need actions: read and contents: read. The reporting caller grants # actions: read, contents: read, pull-requests: write, code-quality: write, diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 7022a03..713dc7e 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index a977f6c..8de80a5 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@95dfb5620ba01b459bcca619eccd0acbad871a8a # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From 397610266e0520c85b1e8fc0260fcbb46e3fc9f5 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 14:01:25 +0100 Subject: [PATCH 22/28] refactor(ci): adopt standalone report publication actions --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__test-action-lint.yml | 2 +- .github/workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 2 +- .../workflows/__test-workflow-continuous-integration.yml | 2 +- actions/lint/action.yml | 4 ++-- actions/test/action.yml | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index e225d9b..aa04bae 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index c6f72f2..370e047 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index 6982f5b..7a51b06 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index ad1a5c3..6687e27 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index a847225..ce1cd5d 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 713dc7e..c0ddf96 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -51,7 +51,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -79,7 +79,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} diff --git a/actions/test/action.yml b/actions/test/action.yml index 8de80a5..ff6a3fd 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -67,7 +67,7 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: operation: prepare definition: ${{ steps.definition.outputs.definition }} @@ -99,7 +99,7 @@ runs: - id: reports name: Validate and retain native reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: operation: finalize recording: ${{ steps.prepare.outputs.recording }} From f60ca351fea4eb9a375865f65638b1a390bbf6d3 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 17:15:24 +0100 Subject: [PATCH 23/28] refactor(reports)!: compose common report preparation --- .github/workflows/__shared-ci.yml | 6 ++-- .github/workflows/__test-action-lint.yml | 4 +-- .../workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 6 ++-- ...__test-workflow-continuous-integration.yml | 2 +- actions/lint/README.md | 30 ++-------------- actions/lint/action.yml | 26 ++++++++------ actions/test/README.md | 34 +++---------------- actions/test/action.yml | 34 ++++++++++++------- docs/development/README.md | 2 +- 10 files changed, 56 insertions(+), 90 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index aa04bae..d4d3912 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index 370e047..ff1d68e 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -50,7 +50,7 @@ jobs: - name: Assert - Native reports and validation result are retained shell: bash run: | - test -f "$REPORT_DIRECTORY/result.json" + test -f "$REPORT_DIRECTORY/report.json" test -s "$REPORT_DIRECTORY/reports/ruff.sarif" env: REPORT_DIRECTORY: ${{ runner.temp }}/retained-reports diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index 7a51b06..d38036c 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 6687e27..2d1c9a0 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -52,5 +52,5 @@ jobs: env: REPORT_DIRECTORY: ${{ runner.temp }}/retained-reports run: | - test -f "$REPORT_DIRECTORY/result.json" - test -s "$REPORT_DIRECTORY/reports/junit.xml" + test -f "$REPORT_DIRECTORY/report.json" + test -s "$REPORT_DIRECTORY/native/1-junit.xml" diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index ce1cd5d..745ea00 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3f3820f46c01e8782de7166ae3fff5a67341ba44 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/actions/lint/README.md b/actions/lint/README.md index be730ac..7d56298 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItcGFja2FnZSIgY29sb3I9ImJsdWUiPjxsaW5lIHgxPSIxNi41IiB5MT0iOS40IiB4Mj0iNy41IiB5Mj0iNC4yMSI+PC9saW5lPjxwYXRoIGQ9Ik0yMSAxNlY4YTIgMiAwIDAgMC0xLTEuNzNsLTctNGEyIDIgMCAwIDAtMiAwbC03IDRBMiAyIDAgMCAwIDMgOHY4YTIgMiAwIDAgMCAxIDEuNzNsNyA0YTIgMiAwIDAgMCAyIDBsNy00QTIgMiAwIDAgMCAyMSAxNnoiPjwvcGF0aD48cG9seWxpbmUgcG9pbnRzPSIzLjI3IDYuOTYgMTIgMTIuMDEgMjAuNzMgNi45NiI+PC9wb2x5bGluZT48bGluZSB4MT0iMTIiIHkxPSIyMi4wOCIgeDI9IjEyIiB5Mj0iMTIiPjwvbGluZT48L3N2Zz4=) GitHub Action: Lint Python -
- Lint Python -
- ---- - @@ -17,9 +11,7 @@ [![Marketplace](https://img.shields.io/badge/Marketplace-lint--python-blue?logo=github-actions)](https://github.com/marketplace/actions/lint-python) [![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-python)](https://github.com/hoverkraft-tech/ci-github-python/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-python)](http://choosealicense.com/licenses/mit/) [![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) @@ -35,8 +27,8 @@ Run setup-python first and declare these tools in the default uv dependency grou All checks execute even when another fails. Ruff writes SARIF into a fresh report directory. Custom commands receive CI_REPORTS_DIR. -Native diagnostics are registered before execution and validated after failures -as well as success. The common ci-reports workflow publishes the final feedback. +Native diagnostics are validated and retained after failures +as well as success. The common publish-ci-reports workflow publishes the final feedback. Producer jobs require actions: read and contents: read. @@ -49,7 +41,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@07283c746a6e2461a240b0328db9c5ad1d4636eb +- uses: hoverkraft-tech/ci-github-python/actions/lint@397610266e0520c85b1e8fc0260fcbb46e3fc9f5 # feat/native-github-coverage with: # uv project directory. # Default: `.` @@ -99,28 +91,12 @@ Producer jobs require actions: read and contents: read. - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) for more details. - - -## License - -This project is licensed under the MIT License. - -SPDX-License-Identifier: MIT - -Copyright © 2026 hoverkraft - -For more details, see the [license](http://choosealicense.com/licenses/mit/). - diff --git a/actions/lint/action.yml b/actions/lint/action.yml index c0ddf96..9d9a444 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -6,8 +6,8 @@ description: | All checks execute even when another fails. Ruff writes SARIF into a fresh report directory. Custom commands receive CI_REPORTS_DIR. - Native diagnostics are registered before execution and validated after failures - as well as success. The common ci-reports workflow publishes the final feedback. + Native diagnostics are validated and retained after failures + as well as success. The common publish-ci-reports workflow publishes the final feedback. Producer jobs require actions: read and contents: read. author: hoverkraft branding: @@ -18,7 +18,8 @@ inputs: description: uv project directory. default: . command: - description: Trusted Bash replacement for Ruff, Black and mypy. Write the declared reports under CI_REPORTS_DIR. + description: Trusted Bash replacement for Ruff, Black and mypy. Write the + declared reports under CI_REPORTS_DIR. default: "" lint-results: description: Required lint report paths relative to CI_REPORTS_DIR, one per line. @@ -51,10 +52,15 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python lint', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: - operation: prepare - definition: ${{ steps.definition.outputs.definition }} + script: | + const fs = require('node:fs'); + const path = require('node:path'); + core.setOutput('report-directory', fs.mkdtempSync(path.join(process.env.RUNNER_TEMP, 'ci-reports-'))); + core.setOutput('definition', process.env.REPORT_DEFINITION); + env: + REPORT_DEFINITION: ${{ steps.definition.outputs.definition }} - id: run shell: bash working-directory: ${{ steps.directory.outputs.absolute-path }} @@ -77,10 +83,10 @@ runs: uv run --locked mypy . || status=1 exit "$status" - id: reports - name: Validate and retain native reports + name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: - operation: finalize - recording: ${{ steps.prepare.outputs.recording }} + definition: ${{ steps.prepare.outputs.definition }} + directory: ${{ steps.prepare.outputs.report-directory }} outcome: ${{ steps.run.outcome }} diff --git a/actions/test/README.md b/actions/test/README.md index e33f2d0..01a64fe 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItcGFja2FnZSIgY29sb3I9ImJsdWUiPjxsaW5lIHgxPSIxNi41IiB5MT0iOS40IiB4Mj0iNy41IiB5Mj0iNC4yMSI+PC9saW5lPjxwYXRoIGQ9Ik0yMSAxNlY4YTIgMiAwIDAgMC0xLTEuNzNsLTctNGEyIDIgMCAwIDAtMiAwbC03IDRBMiAyIDAgMCAwIDMgOHY4YTIgMiAwIDAgMCAxIDEuNzNsNyA0YTIgMiAwIDAgMCAyIDBsNy00QTIgMiAwIDAgMCAyMSAxNnoiPjwvcGF0aD48cG9seWxpbmUgcG9pbnRzPSIzLjI3IDYuOTYgMTIgMTIuMDEgMjAuNzMgNi45NiI+PC9wb2x5bGluZT48bGluZSB4MT0iMTIiIHkxPSIyMi4wOCIgeDI9IjEyIiB5Mj0iMTIiPjwvbGluZT48L3N2Zz4=) GitHub Action: Test Python -
- Test Python -
- ---- - @@ -17,9 +11,7 @@ [![Marketplace](https://img.shields.io/badge/Marketplace-test--python-blue?logo=github-actions)](https://github.com/marketplace/actions/test-python) [![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-python)](https://github.com/hoverkraft-tech/ci-github-python/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-python)](http://choosealicense.com/licenses/mit/) [![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-python?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) @@ -35,9 +27,9 @@ Run setup-python first. Default commands write JUnit and coverage.py XML into a fresh directory. Configure measured packages in [tool.coverage.run]. Custom commands receive CI_REPORTS_DIR and CI_TEST_COVERAGE. -Reports are registered before execution and validated afterward, including after +Reports are validated after execution, including after command failure. Missing or malformed required reports fail the action. Call -the common ci-reports workflow once after all checks; no report outputs need forwarding. +the common publish-ci-reports workflow once after all checks; no report outputs need forwarding. Producer jobs require actions: read and contents: read. @@ -50,7 +42,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@07283c746a6e2461a240b0328db9c5ad1d4636eb +- uses: hoverkraft-tech/ci-github-python/actions/test@397610266e0520c85b1e8fc0260fcbb46e3fc9f5 # feat/native-github-coverage with: # uv project directory. # Default: `.` @@ -63,7 +55,7 @@ Producer jobs require actions: read and contents: read. # Default: `true` coverage: "true" - # Required JUnit or TAP paths relative to CI_REPORTS_DIR, one per line. + # Required test report paths relative to CI_REPORTS_DIR, one per line. # Default: `junit.xml` test-results: junit.xml @@ -83,7 +75,7 @@ Producer jobs require actions: read and contents: read. | **`working-directory`** | uv project directory. | **false** | `.` | | **`command`** | Trusted Bash command replacing pytest. Write reports under CI_REPORTS_DIR and honor CI_TEST_COVERAGE for instrumentation. | **false** | - | | **`coverage`** | Collect test coverage. The default pytest command disables instrumentation when false. | **false** | `true` | -| **`test-results`** | Required JUnit or TAP paths relative to CI_REPORTS_DIR, one per line. | **false** | `junit.xml` | +| **`test-results`** | Required test report paths relative to CI_REPORTS_DIR, one per line. | **false** | `junit.xml` | | **`test-coverage`** | Required native coverage paths relative to CI_REPORTS_DIR when coverage is enabled, one per line. | **false** | `coverage.xml` | @@ -110,28 +102,12 @@ Producer jobs require actions: read and contents: read. - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-python/blob/main/CONTRIBUTING.md) for more details. - - -## License - -This project is licensed under the MIT License. - -SPDX-License-Identifier: MIT - -Copyright © 2026 hoverkraft - -For more details, see the [license](http://choosealicense.com/licenses/mit/). - diff --git a/actions/test/action.yml b/actions/test/action.yml index ff6a3fd..4ae4854 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -6,9 +6,9 @@ description: | fresh directory. Configure measured packages in [tool.coverage.run]. Custom commands receive CI_REPORTS_DIR and CI_TEST_COVERAGE. - Reports are registered before execution and validated afterward, including after + Reports are validated after execution, including after command failure. Missing or malformed required reports fail the action. Call - the common ci-reports workflow once after all checks; no report outputs need forwarding. + the common publish-ci-reports workflow once after all checks; no report outputs need forwarding. Producer jobs require actions: read and contents: read. author: hoverkraft branding: @@ -19,16 +19,19 @@ inputs: description: uv project directory. default: . command: - description: Trusted Bash command replacing pytest. Write reports under CI_REPORTS_DIR and honor CI_TEST_COVERAGE for instrumentation. + description: Trusted Bash command replacing pytest. Write reports under + CI_REPORTS_DIR and honor CI_TEST_COVERAGE for instrumentation. default: "" coverage: - description: Collect test coverage. The default pytest command disables instrumentation when false. + description: Collect test coverage. The default pytest command disables + instrumentation when false. default: "true" test-results: - description: Required JUnit or TAP paths relative to CI_REPORTS_DIR, one per line. + description: Required test report paths relative to CI_REPORTS_DIR, one per line. default: junit.xml test-coverage: - description: Required native coverage paths relative to CI_REPORTS_DIR when coverage is enabled, one per line. + description: Required native coverage paths relative to CI_REPORTS_DIR when + coverage is enabled, one per line. default: coverage.xml outputs: report-artifact-id: @@ -67,10 +70,15 @@ runs: const runtime = await exec.getExecOutput('uv', ['run', '--locked', 'python', '-c', 'import platform; print(platform.python_version())'], {cwd: process.env.WORKING_DIRECTORY, silent: true}); core.setOutput('definition', {name: 'Python tests', project: process.env.DIRECTORY, variant: {runtime: runtime.stdout.trim()}, reports}); - id: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: - operation: prepare - definition: ${{ steps.definition.outputs.definition }} + script: | + const fs = require('node:fs'); + const path = require('node:path'); + core.setOutput('report-directory', fs.mkdtempSync(path.join(process.env.RUNNER_TEMP, 'ci-reports-'))); + core.setOutput('definition', process.env.REPORT_DEFINITION); + env: + REPORT_DEFINITION: ${{ steps.definition.outputs.definition }} - id: run shell: bash working-directory: ${{ steps.directory.outputs.absolute-path }} @@ -97,10 +105,10 @@ runs: fi uv run --locked pytest "${args[@]}" - id: reports - name: Validate and retain native reports + name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: - operation: finalize - recording: ${{ steps.prepare.outputs.recording }} + definition: ${{ steps.prepare.outputs.definition }} + directory: ${{ steps.prepare.outputs.report-directory }} outcome: ${{ steps.run.outcome }} diff --git a/docs/development/README.md b/docs/development/README.md index 27bd7b5..61259a8 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -2,7 +2,7 @@ Install Node.js from `.node-version`, npm, uv and a supported Python runtime, and Docker. Node.js and the development-only `yaml` dependency exercise the actual inline -Actions configuration scripts. Lint and test actions use common `record-ci-reports` for fresh-file validation, +Actions configuration scripts. Lint and test actions use common `prepare-ci-reports` for fresh-file validation, execution identity and retention. Native parsers and publication live only in common. ```sh From 6089594da1c417ea4e380af49f95957f191c117f Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 18:31:06 +0100 Subject: [PATCH 24/28] fix(reports): align artifacts with validated common publication --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__test-action-lint.yml | 4 ++-- .github/workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 2 +- .../workflows/__test-workflow-continuous-integration.yml | 2 +- actions/lint/README.md | 2 +- actions/lint/action.yml | 2 +- actions/test/README.md | 2 +- actions/test/action.yml | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index d4d3912..80b2112 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index ff1d68e..60997cc 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -51,6 +51,6 @@ jobs: shell: bash run: | test -f "$REPORT_DIRECTORY/report.json" - test -s "$REPORT_DIRECTORY/reports/ruff.sarif" + test -s "$REPORT_DIRECTORY/native/1-ruff.sarif" env: REPORT_DIRECTORY: ${{ runner.temp }}/retained-reports diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index d38036c..01c1ee5 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 2d1c9a0..8ef5d70 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 745ea00..2b306e9 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@ad95c2d3354cf5c0755a0325ba55f7615ff0d955 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/actions/lint/README.md b/actions/lint/README.md index 7d56298..214b1ed 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -41,7 +41,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@397610266e0520c85b1e8fc0260fcbb46e3fc9f5 # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/lint@f60ca351fea4eb9a375865f65638b1a390bbf6d3 # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 9d9a444..688af68 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -85,7 +85,7 @@ runs: - id: reports name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: definition: ${{ steps.prepare.outputs.definition }} directory: ${{ steps.prepare.outputs.report-directory }} diff --git a/actions/test/README.md b/actions/test/README.md index 01a64fe..bc74fca 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -42,7 +42,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@397610266e0520c85b1e8fc0260fcbb46e3fc9f5 # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/test@f60ca351fea4eb9a375865f65638b1a390bbf6d3 # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/test/action.yml b/actions/test/action.yml index 4ae4854..8ad300d 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -107,7 +107,7 @@ runs: - id: reports name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: definition: ${{ steps.prepare.outputs.definition }} directory: ${{ steps.prepare.outputs.report-directory }} From 45dcf33362aa3721f965cc1b60cd379aee8c7146 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 18:57:40 +0100 Subject: [PATCH 25/28] fix(reports): adopt file-safe coverage and bounded publication --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__test-action-lint.yml | 2 +- .github/workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 2 +- .../workflows/__test-workflow-continuous-integration.yml | 2 +- actions/lint/README.md | 2 +- actions/lint/action.yml | 2 +- actions/test/README.md | 2 +- actions/test/action.yml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 80b2112..0e0a01e 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index 60997cc..bb9cf0a 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index 01c1ee5..f569e44 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 8ef5d70..65b009f 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 2b306e9..618ff44 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@fad361333873e1a2c66b90a4ded5d8b6b7c4f23d # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/actions/lint/README.md b/actions/lint/README.md index 214b1ed..9237559 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -41,7 +41,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@f60ca351fea4eb9a375865f65638b1a390bbf6d3 # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/lint@6089594da1c417ea4e380af49f95957f191c117f # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/lint/action.yml b/actions/lint/action.yml index 688af68..b5a5285 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -85,7 +85,7 @@ runs: - id: reports name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: definition: ${{ steps.prepare.outputs.definition }} directory: ${{ steps.prepare.outputs.report-directory }} diff --git a/actions/test/README.md b/actions/test/README.md index bc74fca..b7b9f56 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -42,7 +42,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@f60ca351fea4eb9a375865f65638b1a390bbf6d3 # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/test@6089594da1c417ea4e380af49f95957f191c117f # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/test/action.yml b/actions/test/action.yml index 8ad300d..0705f40 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -107,7 +107,7 @@ runs: - id: reports name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: definition: ${{ steps.prepare.outputs.definition }} directory: ${{ steps.prepare.outputs.report-directory }} From e3c3a3a0565efd42236332d9ccb8df7b5403aa38 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 19:27:30 +0100 Subject: [PATCH 26/28] fix(reports): update common reporting dependency --- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__test-action-lint.yml | 2 +- .github/workflows/__test-action-setup-python.yml | 2 +- .github/workflows/__test-action-test.yml | 2 +- .../workflows/__test-workflow-continuous-integration.yml | 2 +- actions/lint/README.md | 2 +- actions/lint/action.yml | 2 +- actions/test/README.md | 2 +- actions/test/action.yml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 0e0a01e..65ee51b 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -4,7 +4,7 @@ name: Internal - Common Continuous Integration tasks permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) permissions: actions: read contents: read @@ -63,7 +63,7 @@ jobs: - test-action-test - test-action-audit - test-action-package-test - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) permissions: actions: read contents: read @@ -90,6 +90,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-action-lint.yml b/.github/workflows/__test-action-lint.yml index bb9cf0a..32423e6 100644 --- a/.github/workflows/__test-action-lint.yml +++ b/.github/workflows/__test-action-lint.yml @@ -18,7 +18,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-setup-python.yml b/.github/workflows/__test-action-setup-python.yml index f569e44..afb9de2 100644 --- a/.github/workflows/__test-action-setup-python.yml +++ b/.github/workflows/__test-action-setup-python.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-action-test.yml b/.github/workflows/__test-action-test.yml index 65b009f..aeb8f82 100644 --- a/.github/workflows/__test-action-test.yml +++ b/.github/workflows/__test-action-test.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} name: Arrange - Check out the repository - name: Assert - Action contract tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 618ff44..8414e3c 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -14,7 +14,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Assert - Workflow configuration tests pass - uses: hoverkraft-tech/ci-github-nodejs/actions/test@c1103859a3e760969aad47921da2174d19b68c92 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/actions/lint/README.md b/actions/lint/README.md index 9237559..e218f13 100644 --- a/actions/lint/README.md +++ b/actions/lint/README.md @@ -41,7 +41,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/lint@6089594da1c417ea4e380af49f95957f191c117f # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/lint@45dcf33362aa3721f965cc1b60cd379aee8c7146 # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/lint/action.yml b/actions/lint/action.yml index b5a5285..6227f1e 100644 --- a/actions/lint/action.yml +++ b/actions/lint/action.yml @@ -85,7 +85,7 @@ runs: - id: reports name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: definition: ${{ steps.prepare.outputs.definition }} directory: ${{ steps.prepare.outputs.report-directory }} diff --git a/actions/test/README.md b/actions/test/README.md index b7b9f56..2b57d7a 100644 --- a/actions/test/README.md +++ b/actions/test/README.md @@ -42,7 +42,7 @@ Producer jobs require actions: read and contents: read. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-python/actions/test@6089594da1c417ea4e380af49f95957f191c117f # feat/native-github-coverage +- uses: hoverkraft-tech/ci-github-python/actions/test@45dcf33362aa3721f965cc1b60cd379aee8c7146 # feat/native-github-coverage with: # uv project directory. # Default: `.` diff --git a/actions/test/action.yml b/actions/test/action.yml index 0705f40..d8244a3 100644 --- a/actions/test/action.yml +++ b/actions/test/action.yml @@ -107,7 +107,7 @@ runs: - id: reports name: Prepare and retain reports if: ${{ !cancelled() && steps.prepare.outcome == 'success' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: definition: ${{ steps.prepare.outputs.definition }} directory: ${{ steps.prepare.outputs.report-directory }} From f15bdb84975d1e1925d0e7ae87c4639262ede1f5 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 1 Dec 2026 09:26:35 +0100 Subject: [PATCH 27/28] refactor(ci): call shared completion workflow --- .github/workflows/__shared-ci.yml | 9 +++------ docs/development/README.md | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 65ee51b..1c83150 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -86,10 +86,7 @@ jobs: - test-action-audit - test-action-package-test - reports - runs-on: ubuntu-latest - timeout-minutes: 5 + uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@cb86863a77462f8837b38ad542b49ab36a825a85 # PR #683 (unreleased) permissions: {} - steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) - with: - job-results: ${{ toJSON(needs) }} + with: + job-results: ${{ toJSON(needs) }} diff --git a/docs/development/README.md b/docs/development/README.md index 61259a8..000566e 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -113,7 +113,7 @@ It uses the same first-party import classification as project-local checks. ## Reporting boundary One outer `ci-reports` job publishes all evidence. A separate required `CI complete` -job checks every producer and reporting with `check-jobs`. Failed native tests +job calls `check-jobs.yml` to check every producer and reporting. Failed native tests fail the producer, while valid reports can still be published successfully. Unexpected skips fail the gate. Configure explicitly allowed conditional skips in the caller; the reporting workflow owns no skip policy. From 1c468fdc6ac242a889c7015d111d48f02e6f8513 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 1 Dec 2026 10:17:36 +0100 Subject: [PATCH 28/28] refactor(ci): clarify artifact-only language workflows --- .github/workflows/continuous-integration.md | 18 +++++++----------- .github/workflows/continuous-integration.yml | 16 ++++++---------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/.github/workflows/continuous-integration.md b/.github/workflows/continuous-integration.md index d387155..bc5e58d 100644 --- a/.github/workflows/continuous-integration.md +++ b/.github/workflows/continuous-integration.md @@ -100,21 +100,17 @@ build backend in `build-system.requires` for reproducible builds. Build backends execute code; Python has no general equivalent to npm's `ignore-scripts` switch. The action does not publish to PyPI. -### Reports and coverage +### Report artifacts Every runtime retains detailed test results. The highest configured version runs lint and coverage once. Default pytest commands disable coverage instrumentation on other versions. Custom commands receive CI_TEST_COVERAGE and CI_REPORTS_DIR. -Outputs are validated by the test action, including after command failure. - -Call ci-github-common's publish-ci-reports.yml once after all producer jobs with -job-results: toJSON(needs). No report plans or artifact IDs need forwarding. -Producer calls need actions: read and contents: read. The reporting caller grants -actions: read, contents: read, pull-requests: write, code-quality: write, -id-token: write and security-events: write; internal publisher jobs narrow these. -Lint and test results default to annotations. Coverage defaults to GitHub when -available, then a comment or summary. Choose destinations using lint-reporters, -test-results-reporters and test-coverage-reporters on that single reporting call. +The lint and test actions validate their outputs and upload report artifacts, +including after command failure. Missing or malformed required reports fail the action. +Producer calls require actions: read and contents: read. + +The caller publishes those artifacts once with `publish-ci-reports.yml`. +See the [common reporting guide](https://github.com/hoverkraft-tech/ci-github-common/blob/44d42ca06b9f722d8ab79af4f588f30ad1e16bc5/docs/usage/ci-reports.md#consumer-workflow). ### Permissions diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b265f9d..d32e8cf 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -70,21 +70,17 @@ # Build backends execute code; Python has no general equivalent to npm's # `ignore-scripts` switch. The action does not publish to PyPI. # -# ### Reports and coverage +# ### Report artifacts # # Every runtime retains detailed test results. The highest configured version runs # lint and coverage once. Default pytest commands disable coverage instrumentation # on other versions. Custom commands receive CI_TEST_COVERAGE and CI_REPORTS_DIR. -# Outputs are validated by the test action, including after command failure. +# The lint and test actions validate their outputs and upload report artifacts, +# including after command failure. Missing or malformed required reports fail the action. +# Producer calls require actions: read and contents: read. # -# Call ci-github-common's publish-ci-reports.yml once after all producer jobs with -# job-results: toJSON(needs). No report plans or artifact IDs need forwarding. -# Producer calls need actions: read and contents: read. The reporting caller grants -# actions: read, contents: read, pull-requests: write, code-quality: write, -# id-token: write and security-events: write; internal publisher jobs narrow these. -# Lint and test results default to annotations. Coverage defaults to GitHub when -# available, then a comment or summary. Choose destinations using lint-reporters, -# test-results-reporters and test-coverage-reporters on that single reporting call. +# The caller publishes those artifacts once with `publish-ci-reports.yml`. +# See the [common reporting guide](https://github.com/hoverkraft-tech/ci-github-common/blob/44d42ca06b9f722d8ab79af4f588f30ad1e16bc5/docs/usage/ci-reports.md#consumer-workflow). # name: Python Continuous Integration "on":