From c931a508d00f4c76d8e9395dafc9ef11d26123d6 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 17:35:42 +0100 Subject: [PATCH 01/26] refactor!: consolidate native IaC reports and separate CI gates --- .../actions/retain-native-reports/action.yml | 40 +++++ .github/linters/actionlint.yml | 15 ++ .github/workflows/__main-ci.yml | 3 +- .github/workflows/__pull-request-ci.yml | 3 +- .github/workflows/__release.yml | 3 +- .github/workflows/__shared-ci.yml | 67 ++++++-- .../__test-actions-ansible-test-molecule.yml | 60 +++++-- .../workflows/__test-actions-ansible-test.yml | 21 ++- .../__test-actions-opentofu-test.yml | 36 ++-- .../workflows/__test-actions-vm-create.yml | 8 +- .../workflows/__test-actions-vm-destroy.yml | 8 +- .github/workflows/__test-actions-vm-test.yml | 65 +++----- CONTRIBUTING.md | 33 +++- actions/_internal/native-reports.cjs | 28 ++++ actions/ansible/test-molecule/action.yml | 73 +++----- actions/ansible/test-molecule/molecule.cjs | 9 +- actions/ansible/test-molecule/package.json | 3 +- .../test-molecule/tests/molecule.test.mjs | 15 +- actions/ansible/test/action.yml | 78 +++------ actions/ansible/test/package.json | 3 +- actions/opentofu/test/action.yml | 68 ++++---- actions/opentofu/test/opentofu.cjs | 17 +- actions/opentofu/test/package.json | 3 +- actions/opentofu/test/tests/reports.test.cjs | 4 +- actions/vm/create/action.yml | 7 +- actions/vm/create/package.json | 3 +- actions/vm/destroy/package.json | 3 +- actions/vm/test/action.yml | 88 ++++------ actions/vm/test/assertions.cjs | 23 +-- actions/vm/test/package.json | 3 +- actions/vm/test/tests/native-reports.test.cjs | 35 ++++ actions/vm/test/tests/reports.test.mjs | 28 +--- .../adr/0002-infrastructure-test-actions.md | 2 + .../0003-consolidated-native-ci-reports.md | 38 +++++ tests/helpers/published-reports.cjs | 156 ++++++++---------- 35 files changed, 572 insertions(+), 477 deletions(-) create mode 100644 .github/actions/retain-native-reports/action.yml create mode 100644 .github/linters/actionlint.yml create mode 100644 actions/_internal/native-reports.cjs create mode 100644 actions/vm/test/tests/native-reports.test.cjs create mode 100644 docs/development/adr/0003-consolidated-native-ci-reports.md diff --git a/.github/actions/retain-native-reports/action.yml b/.github/actions/retain-native-reports/action.yml new file mode 100644 index 0000000..e037ca7 --- /dev/null +++ b/.github/actions/retain-native-reports/action.yml @@ -0,0 +1,40 @@ +name: Retain native IaC reports +description: Stage only bounded native XML files and finalize the common report contract. +inputs: + files: + description: Newline-separated native report paths selected by the producer. + required: true + report-directory: + description: Fresh destination allocated by common recording. + required: true + recording: + description: Prepared common recording handle. + required: true + outcome: + description: Producer execution outcome. + required: true +outputs: + artifact-id: + description: Retained native result artifact. + value: ${{ steps.reports.outputs.artifact-id }} +runs: + using: composite + steps: + - id: stage + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + ACTION_PATH: ${{ github.action_path }} + NATIVE_REPORTS: ${{ inputs.files }} + REPORT_DIRECTORY: ${{ inputs.report-directory }} + with: + script: | + const path = require('node:path'); + const { stageNativeReports } = require(path.resolve(process.env.ACTION_PATH, '../../../actions/_internal/native-reports.cjs')); + stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); + - id: reports + if: ${{ !cancelled() }} + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + operation: finalize + recording: ${{ inputs.recording }} + outcome: ${{ inputs.outcome == 'success' && steps.stage.outcome == 'success' && 'success' || 'failure' }} diff --git a/.github/linters/actionlint.yml b/.github/linters/actionlint.yml new file mode 100644 index 0000000..3e2774f --- /dev/null +++ b/.github/linters/actionlint.yml @@ -0,0 +1,15 @@ +# FIXME: Remove this scoped exception when Actionlint supports code-quality. +# 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"\. diff --git a/.github/workflows/__main-ci.yml b/.github/workflows/__main-ci.yml index 977a149..9b17873 100644 --- a/.github/workflows/__main-ci.yml +++ b/.github/workflows/__main-ci.yml @@ -23,7 +23,8 @@ jobs: name: Continuous Integration uses: $/.github/workflows/__shared-ci.yml permissions: - actions: read + code-quality: write + actions: write contents: read issues: write packages: read diff --git a/.github/workflows/__pull-request-ci.yml b/.github/workflows/__pull-request-ci.yml index 649b13f..3a6b7d2 100644 --- a/.github/workflows/__pull-request-ci.yml +++ b/.github/workflows/__pull-request-ci.yml @@ -19,7 +19,8 @@ jobs: name: Continuous Integration uses: $/.github/workflows/__shared-ci.yml permissions: - actions: read + code-quality: write + actions: write contents: read issues: write packages: read diff --git a/.github/workflows/__release.yml b/.github/workflows/__release.yml index ffc1392..0027c3c 100644 --- a/.github/workflows/__release.yml +++ b/.github/workflows/__release.yml @@ -24,7 +24,8 @@ jobs: if: github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch uses: $/.github/workflows/__shared-ci.yml permissions: - actions: read + code-quality: write + actions: write contents: read issues: write packages: read diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 7ff91d5..c1d9e67 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -20,35 +20,80 @@ jobs: pull-requests: write security-events: write statuses: write - test-action-vm-create: + test-vm-create: permissions: + actions: read contents: read uses: $/.github/workflows/__test-actions-vm-create.yml - test-action-vm-test: + test-vm-test: permissions: - actions: read + actions: write contents: read pull-requests: write uses: $/.github/workflows/__test-actions-vm-test.yml - test-action-vm-destroy: + test-vm-destroy: permissions: + actions: read contents: read uses: $/.github/workflows/__test-actions-vm-destroy.yml - test-action-ansible-test: + test-ansible: permissions: - actions: read + actions: write contents: read pull-requests: write uses: $/.github/workflows/__test-actions-ansible-test.yml - test-action-ansible-test-molecule: + test-molecule: permissions: - actions: read + actions: write contents: read pull-requests: write uses: $/.github/workflows/__test-actions-ansible-test-molecule.yml - test-action-opentofu-test: + test-opentofu: permissions: - actions: read + actions: write contents: read pull-requests: write uses: $/.github/workflows/__test-actions-opentofu-test.yml + + reports: + if: always() + needs: + - linter + - test-vm-create + - test-vm-test + - test-vm-destroy + - test-ansible + - test-molecule + - test-opentofu + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # 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) }} + + complete: + name: CI complete + if: always() + needs: + [ + linter, + test-vm-create, + test-vm-test, + test-vm-destroy, + test-ansible, + test-molecule, + test-opentofu, + reports, + ] + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: {} + steps: + - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 6df9f72..b3f2387 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 permissions: + actions: read contents: read steps: - name: Arrange - Checkout action sources @@ -18,18 +19,19 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info working-directory: actions/ansible/test-molecule command: test:ci - coverage: "" + coverage: "true" local: runs-on: ubuntu-latest timeout-minutes: 12 permissions: - actions: read + actions: write contents: read - pull-requests: write strategy: fail-fast: false matrix: @@ -52,11 +54,17 @@ jobs: molecule-scenario: tests/fixture/molecule/local ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - report-name: Molecule local scenario - ${{ matrix.result }} + - name: Arrange - Download local native-artifacts-0 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-0 + if: ${{ !cancelled() }} - name: Assert - Require native reports and scenario cleanup if: ${{ always() }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 MOLECULE_TEST_DIRECTORY: ${{ runner.temp }}/molecule-local SCENARIO_OUTCOME: ${{ steps.scenario.outcome }} with: @@ -68,18 +76,18 @@ jobs: const expected = process.env.MOLECULE_TEST_RESULT === 'success' ? 'success' : 'failure'; assert.equal(process.env.SCENARIO_OUTCOME, expected); assert.equal(fs.existsSync(process.env.MOLECULE_TEST_DIRECTORY), false); - const [report] = await published.read('molecule-reports-', 1); - assert.ok(report.files.some(file => file.endsWith('/scenario.xml'))); - assert.equal(/<(?:failure|error)\b/.test(report.text), expected === 'failure'); + const [report] = await published.read(1); + assert.ok(report.files.every(file => !file.endsWith('/scenario.xml'))); + assert.equal(report.result.outcome, expected); + await published.discardFailures(); vm: runs-on: ubuntu-latest timeout-minutes: 25 # Keep fixture setup visible in each action's dedicated workflow. # jscpd:ignore-start permissions: - actions: read + actions: write contents: read - pull-requests: write steps: - name: Arrange - Checkout fixture uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -118,12 +126,18 @@ jobs: with: molecule-scenario: tests/fixture/molecule/smoke ansible-requirements: tests/fixture/ansible/requirements.txt - report-name: Molecule - success + - name: Arrange - Download vm native-artifacts-1 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-1 + if: ${{ !cancelled() }} - name: Assert - Check successful Molecule execution if: ${{ !cancelled() && steps.vm.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-1 SUCCESS: ${{ steps.molecule-success.outcome }} with: script: | @@ -131,7 +145,7 @@ jobs: const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); const published = new PublishedReports(github, context); assert.equal(process.env.SUCCESS, 'success'); - await published.read('molecule-reports-', 1); + await published.read(1); - name: Act - Test Molecule assertion-failure id: molecule-assertion-failure @@ -144,12 +158,18 @@ jobs: with: molecule-scenario: tests/fixture/molecule/smoke ansible-requirements: tests/fixture/ansible/requirements.txt - report-name: Molecule - assertion-failure + - name: Arrange - Download vm native-artifacts-2 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-2 + if: ${{ !cancelled() }} - name: Assert - Check Molecule assertion failure and reports if: ${{ !cancelled() && steps.vm.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-2 ASSERTION_FAILURE: ${{ steps.molecule-assertion-failure.outcome }} with: script: | @@ -157,7 +177,7 @@ jobs: const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); const published = new PublishedReports(github, context); assert.equal(process.env.ASSERTION_FAILURE, 'failure'); - await published.read('molecule-reports-', 2); + await published.read(2); - name: Act - Test Molecule idempotence-failure id: molecule-idempotence-failure @@ -170,12 +190,18 @@ jobs: with: molecule-scenario: tests/fixture/molecule/smoke ansible-requirements: tests/fixture/ansible/requirements.txt - report-name: Molecule - idempotence-failure + - name: Arrange - Download vm native-artifacts-3 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-3 + if: ${{ !cancelled() }} - name: Assert - Check Molecule idempotence failure and reports if: ${{ !cancelled() && steps.vm.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-3 IDEMPOTENCE_FAILURE: ${{ steps.molecule-idempotence-failure.outcome }} with: script: | @@ -183,8 +209,8 @@ jobs: const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); const published = new PublishedReports(github, context); assert.equal(process.env.IDEMPOTENCE_FAILURE, 'failure'); - await published.read('molecule-reports-', 3); - + await published.read(3); + await published.discardFailures(); # Fixture teardown is intentionally repeated; action assertions remain above. # jscpd:ignore-start - name: Cleanup - Destroy direct QEMU guest diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 1e31692..1373a22 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 permissions: + actions: read contents: read steps: - name: Arrange - Checkout action sources @@ -18,18 +19,19 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info working-directory: actions/ansible/test command: test:ci - coverage: "" + coverage: "true" scenarios: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - actions: read + actions: write contents: read - pull-requests: write strategy: fail-fast: false matrix: @@ -70,10 +72,16 @@ jobs: collection: ${{ matrix.mode == 'sanity' && 'tests/fixture/ansible/ansible_collections/example/smoke' || '' }} target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - report-name: Ansible tests - ${{ matrix.mode }} - ${{ matrix.result }} + - name: Arrange - Download scenarios native-artifacts-0 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.test.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-0 + if: ${{ !cancelled() }} - name: Assert - Verify check outcomes and native reports if: ${{ always() }} env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 EXPECTED: ${{ matrix.result }} OUTCOME: ${{ steps.test.outcome }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -83,6 +91,7 @@ jobs: const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); const published = new PublishedReports(github, context); assert.equal(process.env.OUTCOME, process.env.EXPECTED); - const [report] = await published.read('ansible-reports-', 1); + const [report] = await published.read(1); assert.ok(report.files.every(file => file.endsWith('.xml'))); assert.equal(/<(?:failure|error)\b/.test(report.text), process.env.EXPECTED === 'failure'); + await published.discardFailures(); diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 386b357..e45aa17 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -8,6 +8,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 permissions: + actions: read contents: read steps: - name: Arrange - Checkout reporting adapter @@ -15,19 +16,19 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info working-directory: actions/opentofu/test command: test:ci - coverage: "" - comment: "false" + coverage: "true" scenarios: runs-on: ubuntu-latest timeout-minutes: 15 permissions: - actions: read + actions: write contents: read - pull-requests: write strategy: fail-fast: false matrix: @@ -51,31 +52,38 @@ jobs: if (process.env.SCENARIO === 'init-failure') fs.writeFileSync('tests/fixture/opentofu/main.tofu', 'invalid {'); - name: Act - Run native OpenTofu tests - id: test + id: opentofu-tests continue-on-error: true uses: $/actions/opentofu/test with: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - report-name: OpenTofu - ${{ matrix.result }} - comment: ${{ matrix.result == 'success' && 'true' || 'false' }} - - name: Assert - Verify outcomes and published safe reports + - name: Arrange - Download scenarios native-artifacts-0 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-0 + if: ${{ !cancelled() }} + - name: Assert - Verify outcomes and retained safe reports if: ${{ always() }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 SCENARIO: ${{ matrix.result }} - OUTCOME: ${{ steps.test.outcome }} + OUTCOME: ${{ steps.opentofu-tests.outcome }} with: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); const success = process.env.SCENARIO === 'success'; assert.equal(process.env.OUTCOME, success ? 'success' : 'failure'); - const [report] = await new PublishedReports(github, context).read('opentofu-test-', 1); - assert.deepEqual(report.files.map(file => require('node:path').basename(file)), ['opentofu.junit.xml']); - assert.equal(/<(?:failure|error)\b/.test(report.text), !success); + const published = new PublishedReports(github, context); + const [report] = await published.read(1); + assert.deepEqual(report.files.map(file => require('node:path').basename(file)), process.env.SCENARIO === 'init-failure' ? [] : ['opentofu.junit.xml']); + assert.equal(report.result.outcome, success ? 'success' : 'failure'); + assert.equal(/<(?:failure|error)\b/.test(report.text), process.env.SCENARIO === 'assertion-failure'); assert.ok(!report.text.includes('synthetic-native-test')); if (success) { assert.match(report.text, /apply_and_read/); - await new PublishedReports(github, context).comment('OpenTofu - success'); } + await published.discardFailures(); diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index dfb6bb2..2607b83 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 permissions: + actions: read contents: read steps: - name: Arrange - Checkout action sources @@ -18,15 +19,18 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info working-directory: actions/vm/create command: test:ci - coverage: "" + coverage: "true" startup: runs-on: ubuntu-latest timeout-minutes: 20 permissions: + actions: read contents: read strategy: fail-fast: false diff --git a/.github/workflows/__test-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index 7469c0c..29f2fdf 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 permissions: + actions: read contents: read steps: - name: Arrange - Checkout action sources @@ -18,15 +19,18 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info working-directory: actions/vm/destroy command: test:ci - coverage: "" + coverage: "true" deletion: runs-on: ubuntu-latest timeout-minutes: 20 permissions: + actions: read contents: read strategy: fail-fast: false diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index e0a6ae6..64273a3 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 permissions: + actions: read contents: read steps: - name: Arrange - Checkout action sources @@ -18,18 +19,19 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@98d91b1cc347efc64cd5fb20bc0ebc076acad114 # 3.1.0 + uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) with: + test-results: junit.xml + test-coverage: lcov.info working-directory: actions/vm/test command: test:ci - coverage: "" + coverage: "true" guest: runs-on: ubuntu-latest timeout-minutes: 25 permissions: - actions: read + actions: write contents: read - pull-requests: write strategy: fail-fast: false matrix: @@ -65,17 +67,6 @@ jobs: sudo -n usermod -aG iac-goss "$(id -un)" ! id -nG | grep -qw iac-goss ' - - name: Arrange - Capture existing comments when publication is disabled - if: ${{ matrix.backend == 'lima' }} - id: comment-before - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - REPORT_NAME: Goss - ${{ matrix.backend }} - valid - with: - script: | - const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); - const published = new PublishedReports(github, context); - core.setOutput('comments', JSON.stringify(await published.readComments(process.env.REPORT_NAME))); - name: Act - Validate valid suite if: ${{ !cancelled() && steps.vm.outcome == 'success' }} id: valid @@ -83,36 +74,29 @@ jobs: uses: $/actions/vm/test with: vm: ${{ steps.vm.outputs.vm }} - comment: ${{ matrix.backend != 'lima' }} goss-file: tests/fixture/goss/valid.yaml goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - report-name: Goss - ${{ matrix.backend }} - valid + - name: Arrange - Download guest native-artifacts-0 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-0 + if: ${{ !cancelled() }} - name: Assert - Check valid results and retained reports if: ${{ !cancelled() && steps.vm.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 OUTCOME: ${{ steps.valid.outcome }} - REPORT_NAME: Goss - ${{ matrix.backend }} - valid - EXPECT_COMMENT: ${{ matrix.backend != 'lima' }} - COMMENTS_BEFORE: ${{ steps.comment-before.outputs.comments }} with: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); const published = new PublishedReports(github, context); assert.equal(process.env.OUTCOME, 'success'); - const reports = await published.read('vm-test-', 1); - assert.ok(reports.some(report => report.text.includes('goss-execution'))); - if (process.env.EXPECT_COMMENT === 'true') { - await published.comment(process.env.REPORT_NAME); - } else { - assert.deepEqual( - await published.readComments(process.env.REPORT_NAME), - JSON.parse(process.env.COMMENTS_BEFORE), - 'Disabled publication must leave existing comments unchanged', - ); - } + const reports = await published.read(1); + assert.ok(reports.some(report => report.files.some(file => file.endsWith('/goss.xml')))); - name: Act - Validate invalid suite if: ${{ !cancelled() && steps.vm.outcome == 'success' }} id: invalid @@ -123,7 +107,6 @@ jobs: goss-file: tests/fixture/goss/invalid.yaml goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - report-name: Goss - ${{ matrix.backend }} - invalid - name: Act - Validate empty suite if: ${{ !cancelled() && steps.vm.outcome == 'success' }} id: empty @@ -134,7 +117,6 @@ jobs: goss-file: tests/fixture/goss/empty.yaml goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - report-name: Goss - ${{ matrix.backend }} - empty - name: Act - Validate timeout suite if: ${{ !cancelled() && steps.vm.outcome == 'success' }} id: timeout @@ -145,11 +127,17 @@ jobs: goss-file: tests/fixture/goss/timeout.yaml goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - report-name: Goss - ${{ matrix.backend }} - timeout - - name: Assert - Check failed suites, independent artifacts and comments + - name: Arrange - Download guest native-artifacts-1 evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} + path: ${{ runner.temp }}/native-artifacts-1 + if: ${{ !cancelled() }} + - name: Assert - Check failed suites and independent native artifacts if: ${{ !cancelled() && steps.vm.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-1 INVALID: ${{ steps.invalid.outcome }} EMPTY: ${{ steps.empty.outcome }} TIMEOUT: ${{ steps.timeout.outcome }} @@ -161,11 +149,10 @@ jobs: for (const outcome of [process.env.INVALID, process.env.EMPTY, process.env.TIMEOUT]) assert.equal(outcome, 'failure'); const published = new PublishedReports(github, context); - const reports = await published.read('vm-test-', 4); - assert.equal(reports.filter(report => report.text.includes('failures="1"')).length, 3); + const reports = await published.read(4); + assert.equal(reports.filter(report => report.result.outcome === 'failure').length, 3); assert.ok(reports.some(report => report.text.includes('iac-missing-synthetic-file'))); - for (const name of ['invalid', 'empty', 'timeout']) - await published.comment(`Goss - ${process.env.BACKEND} - ${name}`); + await published.discardFailures(); - name: Cleanup - Destroy VM if: ${{ always() && steps.vm.outputs.vm != '' }} uses: $/actions/vm/destroy diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53467ea..122e119 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,11 +74,12 @@ action-test workflows for actual VM behavior. PR CI verifies action outcomes across successful assertions, failed assertions and failed startup, without a consumer Makefile. It repeats tests on the same guest to verify independent reports, collects native Goss JUnit -after assertion failures, and verifies action-owned parsing, summaries and -artifact uploads. PR comments reuse stable titles; fork and Dependabot runs skip -comments. Tests inspect native report files and GitHub artifacts directly, and -check published summaries through PR comments when comments are enabled. -Consumer workflows grant comment permissions and always schedule cleanup. +after assertion failures, and verifies native byte preservation and the common +recording contract. The dedicated test workflows download result artifacts through +the shared action and check native content, checksums and private-data exclusion. +Verified negative fixture artifacts are deleted by the test harness before the +outer reporting job, so expected fixture failures do not become real CI findings. +Consumers always schedule infrastructure cleanup. Hosted scenarios are the primary checks for public action behavior. Unit tests call action modules directly where they add distinct coverage: input boundaries, process ownership, failed rollback or deletion, corrupted @@ -100,8 +101,8 @@ directory. Development dependencies supply the same Toolkit helpers injected by the pinned GitHub Script action; production scripts receive them from the caller. For example, run `npm --prefix actions/vm/create ci` followed by `npm --prefix actions/vm/create test` for creation tests. Hosted unit jobs run -`npm run test:ci`: the `pretest:ci` hook creates the -coverage directory, then Node.js writes console results and `coverage/lcov.info`. +`npm run test:ci`: the command writes console output, JUnit and LCOV into the fresh `CI_REPORTS_DIR`, +with coverage enabled only when `CI_TEST_COVERAGE` is true. Generated coverage files are gitignored. `make test` discovers the action packages, installs their locked test dependencies and runs each suite, stopping on failure. Keep reusable test helpers in `tests/helpers/` and synthetic inputs in @@ -288,3 +289,21 @@ Reuse official setup and native execution, keeping only this reporting gap here. Renovate maintains the fixture's `.opentofu-version` and the adapter's Node version; Dependabot maintains the upstream setup Action. Generate its reference with `make docs`. + +## CI reporting ownership + +The VM, Ansible, Molecule and OpenTofu test actions register promised reports +before execution and finalize them through common `record-ci-reports`. Only +native outcomes are counted; execution and cleanup status stay on the producer. +No action posts its own CI comment or generic summary. Upstream Ansible sanity +keeps its own tool summary, while common owns the consolidated evidence view. + +One outer `ci-reports` publishes all evidence. A separate required `CI complete` +job uses common `check-jobs`, requiring every producer and reporting to succeed. +Native test failures can be reported successfully while the gate remains red. +No report-plan output or coverage inventory is forwarded between callers. + +The safety-only helper in `actions/_internal/native-reports.cjs` stages regular +XML files into fresh recorder storage. It never retains environment directories, +VM state, secrets or raw command logs. Each action keeps resource cleanup in its +existing lifecycle, including after execution and reporting failures. diff --git a/actions/_internal/native-reports.cjs b/actions/_internal/native-reports.cjs new file mode 100644 index 0000000..0782ee1 --- /dev/null +++ b/actions/_internal/native-reports.cjs @@ -0,0 +1,28 @@ +const fs = require("node:fs"); +const path = require("node:path"); + +// Copy only verified native files into the recorder's fresh private directory. +// Runtime environments, VM state and raw command logs are never staged. +function stageNativeReports(files, destination) { + const root = fs.realpathSync(destination); + if (!fs.statSync(root).isDirectory() || fs.readdirSync(root).length) + throw new Error("Native report destination must be an empty directory."); + for (const source of [...new Set(files)]) { + const info = fs.lstatSync(source); + if ( + !info.isFile() || + fs.realpathSync(source) !== source || + !source.endsWith(".xml") || + info.size > 20 * 1024 * 1024 + ) + throw new Error( + "Only regular native XML reports up to 20 MiB may be retained.", + ); + fs.copyFileSync( + source, + path.join(root, path.basename(source)), + fs.constants.COPYFILE_EXCL, + ); + } +} +module.exports = { stageNativeReports }; diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index e42e1a6..577e8a3 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -14,7 +14,6 @@ # molecule-scenario: tests/molecule/default # ansible-requirements: requirements.txt # python-version-file: .python-version -# report-name: Ansible integration tests # ``` # # Supply a directory containing `molecule.yml` with @@ -60,21 +59,15 @@ # # ### Publish results # -# Native task reports and a scenario status report are collected after failures. -# Only JUnit files are published; inventory, runtime state and installed tools remain -# private. Reports contain task results: use synthetic data and `no_log` for private values. -# -# Hoverkraft's report actions publish summaries, annotations and stable PR comments. -# Grant `pull-requests: write` for comments; fork PR comments are skipped. -# Never run untrusted tests through `pull_request_target`. Choose distinct report -# names for separate scenarios. Reports are uploaded with a unique artifact name -# and seven-day retention, including after parsing or commenting failures. -# For consolidated comments, set `comment: false` and call the common `ci-reports` -# workflow after all test jobs. Native report artifacts use the `ci-reports-` prefix -# and the current run attempt, so earlier attempts cannot leak stale results. +# Only native test outcomes are retained; no execution-status test is invented. +# Runtime state, inventory, installed tools and raw logs stay private. Native +# assertion details are public: use synthetic data and no_log for private values. +# Call common ci-reports once after all producers, then a separate CI complete +# gate. Producers need contents: read and actions: read, without comment permissions. +# Never execute untrusted tests via pull_request_target. --- name: Ansible - Test Molecule -description: Run native Molecule scenarios with native reports, PR comments and artifacts. +description: Run molecule tests and retain validated native evidence for consolidated CI reporting. author: Hoverkraft branding: icon: check-circle @@ -95,12 +88,10 @@ inputs: test-timeout-minutes: description: Native test sequence deadline, from 1 to 40 minutes. Interrupted runs allow two additional minutes for scenario cleanup. default: "20" - report-name: - description: Stable summary and PR comment title, distinct for each test step or matrix entry. - default: Molecule test results - comment: - description: Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. - default: "true" +outputs: + report-artifact-id: + description: Native result artifact ID, discovered automatically by ci-reports. + value: ${{ steps.reports.outputs.artifact-id }} runs: using: composite steps: @@ -123,6 +114,13 @@ runs: core.setFailed(error.message); } + - name: Register expected native test reports + id: recording + with: + definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' + operation: prepare + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: @@ -174,31 +172,12 @@ runs: core.setFailed(error.message); } - - name: Parse scenario reports - if: ${{ always() && steps.scenario-reports.outputs.report-files != '' }} - id: parse-scenario-reports - uses: hoverkraft-tech/ci-github-common/actions/quality/parse-ci-reports@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - report-name: ${{ inputs.report-name }} - report-paths: ${{ steps.scenario-reports.outputs.report-files }} - path-mapping: ${{ github.workspace }}:. - output-format: summary,markdown,annotations - - - name: Add scenario PR comment - if: >- - ${{ always() && inputs.comment == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.parse-scenario-reports.outputs.markdown != '' }} - uses: hoverkraft-tech/ci-github-common/actions/create-or-update-comment@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - title: ${{ inputs.report-name }} - body: ${{ steps.parse-scenario-reports.outputs.markdown }} - token: ${{ github.token }} - - - name: Upload scenario reports - if: ${{ always() && steps.scenario-reports.outputs.report-files != '' }} - id: upload-scenario-reports - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + - name: Retain Molecule native evidence + id: reports + if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + uses: $/.github/actions/retain-native-reports with: - name: ci-reports-${{ github.run_attempt }}-${{ github.job }}-${{ steps.scenario-inputs.outputs.id }} - path: ${{ steps.scenario-reports.outputs.report-files }} - if-no-files-found: error - retention-days: 7 + outcome: ${{ steps.scenario-execution.outcome == 'success' && steps.scenario-reports.outcome == 'success' && 'success' || 'failure' }} + files: ${{ steps.scenario-reports.outputs.report-files }} + report-directory: ${{ steps.recording.outputs.report-directory }} + recording: ${{ steps.recording.outputs.recording }} diff --git a/actions/ansible/test-molecule/molecule.cjs b/actions/ansible/test-molecule/molecule.cjs index 8fdc1e9..4e289e4 100644 --- a/actions/ansible/test-molecule/molecule.cjs +++ b/actions/ansible/test-molecule/molecule.cjs @@ -89,9 +89,7 @@ class MoleculeScenario { ? await this.execute("destroy", "2m").catch(() => null) : 0; const cleanupFailed = cleanup !== 0; - const native = (await this.reportFiles()).filter( - (file) => path.basename(file) !== "scenario.xml", - ); + const native = await this.reportFiles(); const hasAssertions = native.some((file) => /]/.test(fs.readFileSync(file, "utf8")), ); @@ -99,11 +97,6 @@ class MoleculeScenario { const message = cleanupFailed ? "Molecule was interrupted and scenario cleanup failed" : "Molecule failed, timed out or produced no native assertions"; - fs.writeFileSync( - path.join(this.directory, "scenario.xml"), - `${failed ? `` : ""}\n`, - { flag: "wx" }, - ); if (failed) throw new Error(`${message}; inspect the scenario reports`); } } diff --git a/actions/ansible/test-molecule/package.json b/actions/ansible/test-molecule/package.json index c846950..1804705 100644 --- a/actions/ansible/test-molecule/package.json +++ b/actions/ansible/test-molecule/package.json @@ -9,8 +9,7 @@ }, "scripts": { "test": "node --test", - "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', { recursive: true })\"", - "test:ci": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test" + "test:ci": "node --test-coverage-include='**/actions/ansible/test-molecule/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/ansible/test-molecule/tests/molecule.test.mjs b/actions/ansible/test-molecule/tests/molecule.test.mjs index 602faab..15951cf 100644 --- a/actions/ansible/test-molecule/tests/molecule.test.mjs +++ b/actions/ansible/test-molecule/tests/molecule.test.mjs @@ -1,12 +1,12 @@ -import { suite, test } from "node:test"; -import { MoleculeInputs } from "../inputs.cjs"; -import { MoleculeScenario } from "../molecule.cjs"; -import fs from "node:fs"; -import path from "node:path"; import assert from "node:assert/strict"; +import fs from "node:fs"; import os from "node:os"; +import path from "node:path"; +import { suite, test } from "node:test"; import * as execToolkit from "@actions/exec"; import * as glob from "@actions/glob"; +import { MoleculeInputs } from "../inputs.cjs"; +import { MoleculeScenario } from "../molecule.cjs"; // Copy the ESM namespace so tests can mock the injected helper. const exec = { ...execToolkit }; @@ -192,10 +192,7 @@ suite("ansible/test-molecule", () => { "--scenario-name", "default", ]); - assert.match( - fs.readFileSync(path.join(directory, "scenario.xml"), "utf8"), - /failures="1"/, - ); + assert.equal(fs.existsSync(path.join(directory, "scenario.xml")), false); }); test("Molecule cannot succeed with empty or redirected native assertions", async (t) => { diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index c795686..6bd4648 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -43,26 +43,15 @@ # # ### Publish results # -# Hoverkraft's `parse-ci-reports` publishes native JUnit as summaries, annotations -# and a stable PR comment. Test output and task results appear in these reports; -# use synthetic data suitable for the repository's visibility. The collection -# action also publishes its own summary. -# -# Report collection runs after upstream failures, including when the upstream -# action does not export its report output. Reports are uploaded with a unique -# artifact name and seven-day retention, including after parsing or commenting -# errors. Missing reports fail the action. Failed tests remain failures. No custom -# test runner or Docker lifecycle is maintained here. -# -# Grant `pull-requests: write` for comments. Fork PR comments are skipped. -# Never run untrusted tests through `pull_request_target`. Use distinct report names -# for matrix entries. -# For consolidated comments, set `comment: false` and call the common `ci-reports` -# workflow after all test jobs. Native report artifacts use the `ci-reports-` prefix -# and the current run attempt, so earlier attempts cannot leak stale results. +# Native JUnit is validated and retained through common record-ci-reports. +# Use synthetic expectations: native reports may contain assertion details. +# Call ci-reports once after every producer and add a separate CI complete gate. +# Producers need contents: read and actions: read, without comment permissions. +# Upstream collection sanity owns its diagnostic summary. It does not create +# the consolidated report or comment. Never use pull_request_target for tests. --- name: Ansible - Test -description: Run Ansible test playbooks and collection sanity with native reports, PR comments and artifacts. +description: Run ansible tests and retain validated native evidence for consolidated CI reporting. author: Hoverkraft branding: icon: check-circle @@ -92,12 +81,10 @@ inputs: galaxy-requirements: description: Optional checkout-relative Galaxy requirements file for third-party role and collection dependencies. default: "" - report-name: - description: Stable summary and PR comment title, distinct for each test step or matrix entry. - default: Ansible test results - comment: - description: Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. - default: "true" +outputs: + report-artifact-id: + description: Native result artifact ID, discovered automatically by ci-reports. + value: ${{ steps.reports.outputs.artifact-id }} runs: using: composite steps: @@ -123,6 +110,13 @@ runs: core.setFailed(error.message); } + - name: Register expected native test reports + id: recording + with: + definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' + operation: prepare + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 @@ -144,6 +138,7 @@ runs: core.addPath(path.join(runtime, 'bin')); - name: Execute Ansible test playbook + id: playbook if: steps.inputs.outputs.mode == 'playbook' uses: dawidd6/action-ansible-playbook@126642a1c6ce512da255ef2b41e8ee90f0077474 # v9 env: @@ -187,31 +182,12 @@ runs: core.setFailed(error.message); } - - name: Parse Ansible reports - if: ${{ always() && steps.collect.outputs.report-files != '' }} - id: parse - uses: hoverkraft-tech/ci-github-common/actions/quality/parse-ci-reports@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - report-name: ${{ inputs.report-name }} - report-paths: ${{ steps.collect.outputs.report-files }} - path-mapping: ${{ github.workspace }}:. - output-format: summary,markdown,annotations - - - name: Add Ansible PR comment - if: >- - ${{ always() && inputs.comment == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.parse.outputs.markdown != '' }} - uses: hoverkraft-tech/ci-github-common/actions/create-or-update-comment@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - title: ${{ inputs.report-name }} - body: ${{ steps.parse.outputs.markdown }} - token: ${{ github.token }} - - - name: Upload Ansible reports - if: ${{ always() && steps.collect.outputs.report-files != '' }} - id: upload - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + - name: Retain Ansible native evidence + id: reports + if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + uses: $/.github/actions/retain-native-reports with: - name: ci-reports-${{ github.run_attempt }}-${{ github.job }}-${{ steps.inputs.outputs.id }} - path: ${{ steps.collect.outputs.report-files }} - if-no-files-found: error - retention-days: 7 + outcome: ${{ (steps.inputs.outputs.mode == 'playbook' && steps.playbook.outcome == 'success' || steps.inputs.outputs.mode == 'sanity' && steps.sanity.outcome == 'success') && steps.collect.outcome == 'success' && 'success' || 'failure' }} + files: ${{ steps.collect.outputs.report-files }} + report-directory: ${{ steps.recording.outputs.report-directory }} + recording: ${{ steps.recording.outputs.recording }} diff --git a/actions/ansible/test/package.json b/actions/ansible/test/package.json index 6cbba8e..83c7d7d 100644 --- a/actions/ansible/test/package.json +++ b/actions/ansible/test/package.json @@ -9,8 +9,7 @@ }, "scripts": { "test": "node --test", - "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', { recursive: true })\"", - "test:ci": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test" + "test:ci": "node --test-coverage-include='**/actions/ansible/test/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/glob": "0.7.0" diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index f2bec38..019b32b 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -19,13 +19,15 @@ # incomplete reports and cleanup errors remain failures. Use synthetic fixtures; # test names and filenames are public report metadata. # -# Reports are parsed as summaries and annotations and retained for seven days, -# including after test failures. Set `comment: false` with the common `ci-reports` -# workflow to consolidate results. Individual comments require `pull-requests: write` -# and are skipped for fork PRs. Never execute untrusted tests via pull_request_target. +# Only native test outcomes are retained; no execution-status test is invented. +# Runtime state, inventory, installed tools and raw logs stay private. Native +# assertion details are public: use synthetic data and no_log for private values. +# Call common ci-reports once after all producers, then a separate CI complete +# gate. Producers need contents: read and actions: read, without comment permissions. +# Never execute untrusted tests via pull_request_target. --- name: OpenTofu - Test -description: Run native OpenTofu tests with the official runtime, summaries, JUnit artifacts and optional PR comments. +description: Run opentofu tests and retain validated native evidence for consolidated CI reporting. author: Hoverkraft branding: icon: check-circle @@ -37,12 +39,10 @@ inputs: tofu-version-file: description: Checkout-relative file containing an exact stable OpenTofu version maintained by the consumer. required: true - report-name: - description: Stable report title, distinct for each test step or matrix entry. - default: OpenTofu test results - comment: - description: Publish an individual PR comment. Set false when using the shared ci-reports workflow. - default: "true" +outputs: + report-artifact-id: + description: Native result artifact ID, discovered automatically by ci-reports. + value: ${{ steps.reports.outputs.artifact-id }} runs: using: composite steps: @@ -70,11 +70,19 @@ runs: if (!directory && !/^\d+\.\d+\.\d+$/.test(fs.readFileSync(resolved, 'utf8').trim())) throw new Error('Pin one stable OpenTofu release in tofu-version-file'); core.setOutput(name, resolved); + if (directory) core.setOutput('project', path.relative(root, resolved) || '.'); } const reports = fs.mkdtempSync(path.join(process.env.RUNNER_TEMP, 'opentofu-test-')); core.setOutput('directory', reports); core.setOutput('id', path.basename(reports)); + - name: Register expected native test reports + id: recording + with: + definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} + operation: prepare + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 with: @@ -82,7 +90,7 @@ runs: tofu_wrapper: false - name: Run native OpenTofu tests - id: test + id: opentofu-tests uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: ACTION_PATH: ${{ github.action_path }} @@ -95,32 +103,12 @@ runs: const { OpenTofuTests } = require(`${process.env.ACTION_PATH}/opentofu.cjs`); await new OpenTofuTests(core, exec).run(process.env.MODULE_PATH, process.env.REPORT_DIRECTORY); - - name: Parse OpenTofu reports - id: parse - if: ${{ !cancelled() && steps.test.outputs.report != '' }} - uses: hoverkraft-tech/ci-github-common/actions/quality/parse-ci-reports@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - report-name: ${{ inputs.report-name }} - report-paths: ${{ steps.test.outputs.report }} - output-format: summary,markdown,annotations - - # Standard standalone-action comment publication shared by test actions. - # jscpd:ignore-start - - name: Add OpenTofu PR comment - if: >- - ${{ !cancelled() && inputs.comment == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.parse.outputs.markdown != '' }} - uses: hoverkraft-tech/ci-github-common/actions/create-or-update-comment@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - title: ${{ inputs.report-name }} - body: ${{ steps.parse.outputs.markdown }} - token: ${{ github.token }} - # jscpd:ignore-end - - - name: Upload OpenTofu reports - if: ${{ !cancelled() && steps.test.outputs.report != '' }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + - name: Retain OpenTofu native evidence + id: reports + if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + uses: $/.github/actions/retain-native-reports with: - name: ci-reports-${{ github.run_attempt }}-${{ github.job }}-${{ steps.inputs.outputs.id }} - path: ${{ steps.test.outputs.report }} - if-no-files-found: error - retention-days: 7 + outcome: ${{ steps.opentofu-tests.outcome == 'success' && 'success' || 'failure' }} + files: ${{ steps.opentofu-tests.outputs.report }} + report-directory: ${{ steps.recording.outputs.report-directory }} + recording: ${{ steps.recording.outputs.recording }} diff --git a/actions/opentofu/test/opentofu.cjs b/actions/opentofu/test/opentofu.cjs index 2b4ed24..fbc573c 100644 --- a/actions/opentofu/test/opentofu.cjs +++ b/actions/opentofu/test/opentofu.cjs @@ -44,15 +44,6 @@ class OpenTofuReport { summary.passed > 0 && summary.failed === 0 && summary.errored === 0; - if ( - !passed && - !cases.some((item) => ["fail", "error"].includes(item.status)) - ) - cases.push({ - file: "OpenTofu", - name: "execution-and-cleanup", - status: "error", - }); return new OpenTofuReport(cases, passed); } @@ -135,10 +126,12 @@ class OpenTofuTests { code, ); } catch { - result = new OpenTofuReport([ - { file: "OpenTofu", name: "execution-and-reporting", status: "error" }, - ]); + this.core.setFailed( + "OpenTofu initialization or native report collection failed.", + ); + return; } + const report = path.join(reports, "opentofu.junit.xml"); fs.writeFileSync(report, result.xml, { mode: 0o600, flag: "wx" }); this.core.setOutput("report", report); diff --git a/actions/opentofu/test/package.json b/actions/opentofu/test/package.json index 8f52e97..48f50b4 100644 --- a/actions/opentofu/test/package.json +++ b/actions/opentofu/test/package.json @@ -9,7 +9,6 @@ }, "scripts": { "test": "node --test", - "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', { recursive: true })\"", - "test:ci": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test" + "test:ci": "node --test-coverage-include='**/actions/opentofu/test/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" } } diff --git a/actions/opentofu/test/tests/reports.test.cjs b/actions/opentofu/test/tests/reports.test.cjs index 05bcb78..1605669 100644 --- a/actions/opentofu/test/tests/reports.test.cjs +++ b/actions/opentofu/test/tests/reports.test.cjs @@ -57,8 +57,8 @@ suite("Native OpenTofu reporting boundaries", () => { const result = OpenTofuReport.parse(events, 1); // Assert assert.equal(result.passed, false); - assert.match(result.xml, /execution-and-cleanup/); - assert.match(result.xml, /errors="1"/); + assert.doesNotMatch(result.xml, /execution-and-cleanup/); + assert.match(result.xml, /errors="0"/); }); for (const [name, events] of [ diff --git a/actions/vm/create/action.yml b/actions/vm/create/action.yml index 534b8c9..c390e64 100644 --- a/actions/vm/create/action.yml +++ b/actions/vm/create/action.yml @@ -21,7 +21,6 @@ # with: # vm: ${{ steps.vm.outputs.vm }} # goss-file: tests/goss.yaml -# report-name: Infrastructure VM tests # - name: Destroy VM # if: ${{ always() && steps.vm.outputs.vm != '' }} # uses: hoverkraft-tech/ci-github-iac/actions/vm/destroy@ @@ -35,9 +34,9 @@ # Reference the creation step's `name` and `ssh-config` outputs in that scenario's # inventory; Molecule's target and sequence are configured by the scenario. # -# Default GitHub reporting needs `pull-requests: write` for PR comments. Other -# reporting modes and permissions are documented by `vm/test`. The maintained -# [VM test workflow](../../../.github/workflows/__test-actions-vm-test.yml) also +# Call common `ci-reports` once after all producers to publish the consolidated +# report, then use a separate `CI complete` gate. Producers need `actions: read`. +# The maintained [VM test workflow](../../../.github/workflows/__test-actions-vm-test.yml) also # covers failures and repeated tests. No consumer Makefile is required. # # ### Runner and configuration diff --git a/actions/vm/create/package.json b/actions/vm/create/package.json index 5b58fec..bbde306 100644 --- a/actions/vm/create/package.json +++ b/actions/vm/create/package.json @@ -9,8 +9,7 @@ }, "scripts": { "test": "node --test", - "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', { recursive: true })\"", - "test:ci": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test" + "test:ci": "node --test-coverage-include='**/actions/vm/create/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/vm/destroy/package.json b/actions/vm/destroy/package.json index 316aa38..ceaa7c6 100644 --- a/actions/vm/destroy/package.json +++ b/actions/vm/destroy/package.json @@ -9,8 +9,7 @@ }, "scripts": { "test": "node --test", - "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', { recursive: true })\"", - "test:ci": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test" + "test:ci": "node --test-coverage-include='**/actions/vm/destroy/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 58d693f..83a96fb 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -26,28 +26,20 @@ # suites fail. Reports are collected after failed assertions; private guest test # files are then removed. Incomplete transfers are never published. # -# ### Publish results +# ### Retain results # -# Each invocation publishes native JUnit plus a sanitized execution-status report -# through Hoverkraft's report parser: job summary, annotations and, on eligible -# pull requests, an updated comment. Use a distinct stable `report-name` for each -# step and matrix scenario. Comments use `github.token` and require -# `pull-requests: write`; fork PRs still receive summaries and artifacts. -# Do not use `pull_request_target` to execute untrusted suites. -# -# Completed reports are retained as a unique GitHub artifact for seven days, even -# after parser or comment failure. Raw command output and exceptions are excluded -# from the execution-status report. Native Goss reports retain assertion details: -# use synthetic expectations and never match or print credentials. Infrastructure -# assertions produce test results, not application code coverage. -# -# See the [lifecycle example](../create/README.md#compose-the-vm-actions). -# For consolidated comments, set `comment: false` and call the common `ci-reports` -# workflow after all test jobs. Native report artifacts use the `ci-reports-` prefix -# and the current run attempt, so earlier attempts cannot leak stale results. +# Each invocation registers its expected native Goss JUnit report before testing, +# then validates and retains it even after assertion failures. No synthetic test +# case is added for execution status. VM cleanup stays with the caller. +# Native assertion details are public: never match or print credentials. +# Infrastructure assertions produce test results, not application code coverage. +# Call common ci-reports once after all test jobs. Producers need contents: read +# and actions: read; comments and summaries belong to the reporting workflow. +# Use a separate CI complete gate for all required jobs and reporting. +# Never use pull_request_target to execute untrusted suites. --- name: VM - Test -description: Validate VM state with Goss, publish summaries and PR comments, and upload JUnit results. +description: Run vm tests and retain validated native evidence for consolidated CI reporting. author: Hoverkraft branding: icon: check-circle @@ -65,15 +57,20 @@ inputs: test-timeout-minutes: description: Combined Goss setup and execution timeout, from 1 to 40 minutes. default: "10" - report-name: - description: Summary and PR comment title. Use a distinct stable name for each test step and matrix scenario. - default: VM test results - comment: - description: Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. - default: "true" +outputs: + report-artifact-id: + description: Native result artifact ID, discovered automatically by ci-reports. + value: ${{ steps.reports.outputs.artifact-id }} runs: using: composite steps: + - name: Register expected native test reports + id: recording + with: + definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' + operation: prepare + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + - name: Run Goss assertions id: test uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -96,9 +93,8 @@ runs: try { await assertions.run(new Guest(process.env.VM_DIRECTORY, { exec }), { exec, io }); } finally { - if (assertions.report || assertions.reportFiles?.length) + if (assertions.reportFiles?.length) core.setOutput("id", assertions.id); - if (assertions.report) core.setOutput("report", assertions.report); if (assertions.reportFiles?.length) core.setOutput("report-files", assertions.reportFiles.join("\n")); } @@ -106,34 +102,12 @@ runs: core.setFailed("Goss assertions or report collection failed. Inspect the available reports."); } - - name: Parse test reports - if: ${{ always() && (steps.test.outputs.report-files != '' || steps.test.outputs.report != '') }} - id: parse-test-reports - uses: hoverkraft-tech/ci-github-common/actions/quality/parse-ci-reports@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - report-name: ${{ inputs.report-name }} - report-paths: | - ${{ steps.test.outputs.report }} - ${{ steps.test.outputs.report-files }} - output-format: summary,markdown,annotations - - - name: Add test PR comment - if: >- - ${{ always() && inputs.comment == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.parse-test-reports.outputs.markdown != '' }} - uses: hoverkraft-tech/ci-github-common/actions/create-or-update-comment@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 - with: - title: ${{ inputs.report-name }} - body: ${{ steps.parse-test-reports.outputs.markdown }} - token: ${{ github.token }} - - - name: Upload test reports - if: ${{ always() && (steps.test.outputs.report-files != '' || steps.test.outputs.report != '') }} - id: upload - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + - name: Retain VM native evidence + id: reports + if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + uses: $/.github/actions/retain-native-reports with: - name: ci-reports-${{ github.run_attempt }}-${{ github.job }}-${{ steps.test.outputs.id }} - path: | - ${{ steps.test.outputs.report }} - ${{ steps.test.outputs.report-files }} - if-no-files-found: error - retention-days: 7 + outcome: ${{ steps.test.outcome == 'success' && 'success' || 'failure' }} + files: ${{ steps.test.outputs.report-files }} + report-directory: ${{ steps.recording.outputs.report-directory }} + recording: ${{ steps.recording.outputs.recording }} diff --git a/actions/vm/test/assertions.cjs b/actions/vm/test/assertions.cjs index d624f25..592bc62 100644 --- a/actions/vm/test/assertions.cjs +++ b/actions/vm/test/assertions.cjs @@ -25,12 +25,10 @@ class GuestAssertions { } async run(vm, { exec, io }) { - this.report = undefined; this.reportFiles = []; await io.mkdirP(this.directory); const directory = fs.mkdtempSync(path.join(this.directory, "vm-test-")); this.id = path.basename(directory); - const report = path.join(directory, "e2e.junit.xml"); const started = performance.now(); let failed = false; try { @@ -71,7 +69,7 @@ class GuestAssertions { try { this.goss.validateReports(this.reportFiles); } catch (error) { - // Empty native suites cannot replace the failed execution summary. + // Empty native suites cannot satisfy the promised test report. this.reportFiles = []; throw error; } @@ -84,25 +82,6 @@ class GuestAssertions { failed = true; } } - const duration = ((performance.now() - started) / 1000).toFixed(3); - // All XML text is fixed; no paths, guest output or error details are serialized. - const failure = failed - ? '' - : ""; - try { - fs.writeFileSync( - report, - '\n' + - `` + - `${failure}\n`, - { flag: "wx" }, - ); - } catch (error) { - await io.rmRF(report); - if (!this.reportFiles.length) await io.rmRF(directory); - throw error; - } - this.report = report; if (failed) throw new Error("Goss assertions failed"); } } diff --git a/actions/vm/test/package.json b/actions/vm/test/package.json index f6487c1..9a5a7d4 100644 --- a/actions/vm/test/package.json +++ b/actions/vm/test/package.json @@ -9,8 +9,7 @@ }, "scripts": { "test": "node --test", - "pretest:ci": "node -e \"require('node:fs').mkdirSync('coverage', { recursive: true })\"", - "test:ci": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test" + "test:ci": "node --test-coverage-include='**/actions/vm/test/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/vm/test/tests/native-reports.test.cjs b/actions/vm/test/tests/native-reports.test.cjs new file mode 100644 index 0000000..c14c303 --- /dev/null +++ b/actions/vm/test/tests/native-reports.test.cjs @@ -0,0 +1,35 @@ +const assert = require("node:assert/strict"); +const fs = require("node:fs"); +const os = require("node:os"); +const path = require("node:path"); +const { suite, test } = require("node:test"); +const { stageNativeReports } = require("../../../_internal/native-reports.cjs"); + +suite("native report staging", () => { + test("preserves bytes and rejects private files, symlinks and reused destinations", (t) => { + // Arrange + const root = fs.mkdtempSync(path.join(os.tmpdir(), "native-staging-")); + t.after(() => fs.rmSync(root, { recursive: true, force: true })); + const output = path.join(root, "output"); + fs.mkdirSync(output); + const source = path.join(root, "result.xml"); + fs.writeFileSync(source, ""); + const privateFile = path.join(root, "state.json"); + fs.writeFileSync(privateFile, "private"); + const link = path.join(root, "linked.xml"); + fs.symlinkSync(source, link); + // Act + const stage = (files) => () => stageNativeReports(files, output); + // Assert + assert.throws(stage([privateFile]), /Only regular native XML/); + assert.throws(stage([link]), /Only regular native XML/); + // Act + stage([source])(); + // Assert + assert.deepEqual( + fs.readFileSync(path.join(output, "result.xml")), + fs.readFileSync(source), + ); + assert.throws(stage([source]), /empty directory/); + }); +}); diff --git a/actions/vm/test/tests/reports.test.mjs b/actions/vm/test/tests/reports.test.mjs index 67f3368..823239e 100644 --- a/actions/vm/test/tests/reports.test.mjs +++ b/actions/vm/test/tests/reports.test.mjs @@ -2,10 +2,10 @@ import assert from "node:assert/strict"; import fs from "node:fs"; import path from "node:path"; import { suite, test } from "node:test"; -import { GuestReports } from "../reports.cjs"; -import { GuestAssertions } from "../assertions.cjs"; import * as exec from "@actions/exec"; import * as io from "@actions/io"; +import { GuestAssertions } from "../assertions.cjs"; +import { GuestReports } from "../reports.cjs"; async function fixture(t) { const directory = fs.mkdtempSync("/tmp/report-test-"); @@ -75,9 +75,7 @@ suite("vm/test - report safety", () => { assert.equal(fs.existsSync(guest), false); assert.equal(assertions.reportFiles.length, 1); assert.equal(fs.readFileSync(assertions.reportFiles[0], "utf8"), xml); - const status = fs.readFileSync(assertions.report, "utf8"); - assert.match(status, /failures="1"/); - assert.equal(status.includes("synthetic-private-output"), false); + assert.equal(xml.includes("synthetic-private-output"), false); assert.equal( fs.existsSync(path.join(directory, "guest/private.txt")), false, @@ -89,7 +87,6 @@ suite("vm/test - report safety", () => { "partial-transfer", "cleanup", "empty-suite", - "report-write", ]) { test(`${failure} fails without publishing incomplete results`, async (t) => { // Arrange @@ -115,31 +112,14 @@ suite("vm/test - report safety", () => { throw new Error("cleanup failed"); return execute(args); }); - if (failure === "report-write") { - const write = fs.writeFileSync; - t.mock.method(fs, "writeFileSync", (file, ...args) => { - if (file.endsWith("e2e.junit.xml")) { - write(file, "partial"); - throw new Error("write failed"); - } - return write(file, ...args); - }); - } // Act const run = () => assertions.run(vm, { exec, io }); // Assert await assert.rejects(run); assert.equal( assertions.reportFiles.length, - ["cleanup", "report-write"].includes(failure) ? 1 : 0, + failure === "cleanup" ? 1 : 0, ); - if (failure === "report-write") - assert.equal(assertions.report, undefined); - else - assert.match( - fs.readFileSync(assertions.report, "utf8"), - /failures="1"/, - ); assert.equal(fs.existsSync(guest), failure === "cleanup"); }); } diff --git a/docs/development/adr/0002-infrastructure-test-actions.md b/docs/development/adr/0002-infrastructure-test-actions.md index 4e09cc0..6561de0 100644 --- a/docs/development/adr/0002-infrastructure-test-actions.md +++ b/docs/development/adr/0002-infrastructure-test-actions.md @@ -8,6 +8,8 @@ Status: Accepted. Implementation is under review in Extends the backend and test execution contracts in [ADR 0001](0001-vm-actions.md) and supersedes its mandatory external entrypoints. +Reporting responsibilities are superseded by [ADR 0003](0003-consolidated-native-ci-reports.md). + ## Context The Proxmox installation consumer needs direct QEMU because installation inside diff --git a/docs/development/adr/0003-consolidated-native-ci-reports.md b/docs/development/adr/0003-consolidated-native-ci-reports.md new file mode 100644 index 0000000..93e822a --- /dev/null +++ b/docs/development/adr/0003-consolidated-native-ci-reports.md @@ -0,0 +1,38 @@ +# ADR 0003: Consolidated native CI reports + +Date: 2026-11-28. + +Status: Accepted. Supersedes the per-action publication and synthetic scenario +status reports in [ADR 0002](0002-infrastructure-test-actions.md). + +## Decision + +Test actions own execution, native result validation and safe retention. They +register expected evidence before executing tests and finalize it through common +`record-ci-reports`, including after failures. The shared staging helper retains +only bounded regular XML files; runtime state, environments and logs stay private. + +One outer common `ci-reports` workflow publishes annotations, summaries and the +consolidated comment. Its success means reporting succeeded. A separate +`CI complete` gate requires all producers and reporting to succeed, including VM +cleanup. Workflows continue to own VM lifetime and unconditional destruction. + +Remove `comment` and `report-name` inputs and export `report-artifact-id` for +inspection. Ordinary consumers need no artifact inventory. Stop inventing JUnit +test cases for command execution or cleanup; those failures remain action failures. +Native assertion counts now describe actual tests only. + +## Consequences + +This requires a breaking release. Consumers remove per-action reporting options +and add one outer reporting call and completion gate. Producers need read access +to Actions and contents; publication permissions belong to the reporting job. + +Hosted action tests inspect retained bytes and native outcomes. Only after their +assertions succeed may tests delete their own deliberately failing fixture results +and registrations, so those fixtures do not become real consolidated CI findings. + +The [common reporting contract](https://github.com/hoverkraft-tech/ci-github-common/blob/feat/native-github-coverage/docs/usage/ci-reports.md) +owns formats, discovery and publisher behavior. Common is released first, followed +by the language provider and this migration; candidate pins are replaced with +released SHAs before merging. diff --git a/tests/helpers/published-reports.cjs b/tests/helpers/published-reports.cjs index c333744..ac6cdd4 100644 --- a/tests/helpers/published-reports.cjs +++ b/tests/helpers/published-reports.cjs @@ -1,110 +1,90 @@ const assert = require("node:assert/strict"); const fs = require("node:fs"); const path = require("node:path"); +const { createHash } = require("node:crypto"); -// Hosted assertions inspect report side effects without expanding the public API. +// Inspect the actual retained bytes through the shared download action. class PublishedReports { constructor(github, context) { - this.github = github; - this.context = context; + Object.assign(this, { github, context }); } - - async read(prefix, expectedCount) { - const directories = fs - .readdirSync(process.env.RUNNER_TEMP, { withFileTypes: true }) - .filter((entry) => entry.isDirectory() && entry.name.startsWith(prefix)) - .map((entry) => path.join(process.env.RUNNER_TEMP, entry.name)); - assert.equal(directories.length, expectedCount); - let artifacts = []; - // Upload completion can precede visibility in GitHub's artifact list. - const deadline = Date.now() + 60_000; - while (true) { - artifacts = await this.github.paginate( - this.github.rest.actions.listWorkflowRunArtifacts, - { ...this.context.repo, run_id: this.context.runId, per_page: 100 }, + async read(expectedCount) { + const directory = process.env.EVIDENCE_DIRECTORY; + const manifests = fs + .readdirSync(directory, { recursive: true }) + .filter((file) => path.basename(file) === "result.json"); + assert.equal(manifests.length, expectedCount); + const artifacts = await this.github.paginate( + this.github.rest.actions.listWorkflowRunArtifacts, + { ...this.context.repo, run_id: this.context.runId, per_page: 100 }, + ); + return manifests.map((file) => { + const root = path.dirname(path.join(directory, file)); + const result = JSON.parse( + fs.readFileSync(path.join(root, "result.json"), "utf8"), ); - if ( - directories.every((directory) => - artifacts.some( - (item) => - item.name.startsWith( - `ci-reports-${process.env.GITHUB_RUN_ATTEMPT}-`, - ) && item.name.endsWith(`-${path.basename(directory)}`), - ), - ) || - Date.now() >= deadline - ) - break; - await new Promise((resolve) => setTimeout(resolve, 2_000)); - } - return directories.map((directory) => { - assert.equal(fs.statSync(directory).mode & 0o777, 0o700); + assert.equal(result.version, 2); + assert.match(result.id, /^[a-f0-9-]{36}$/); const artifact = artifacts.find( - (item) => - item.name.startsWith( - `ci-reports-${process.env.GITHUB_RUN_ATTEMPT}-`, - ) && item.name.endsWith(`-${path.basename(directory)}`), + (item) => item.name === `ci-report-v2-result-${result.id}`, ); - assert.ok( - artifact, - `Missing uploaded reports for ${path.basename(directory)}`, - ); - assert.ok(artifact.size_in_bytes > 0); + assert.ok(artifact); assert.equal(artifact.expired, false); - const files = fs - .readdirSync(directory) - .filter((name) => /\.(xml|info|json)$/.test(name)) - .map((name) => path.join(directory, name)); - for (const name of ["guest"]) { - const source = path.join(directory, name); - if (!fs.existsSync(source)) continue; - for (const relative of fs.readdirSync(source, { recursive: true })) { - const file = path.join(source, relative); - if (fs.lstatSync(file).isFile()) files.push(file); - } + const files = result.assets.map((asset) => path.join(root, asset.file)); + for (const asset of result.assets) { + assert.match(asset.file, /^reports\/[^/]+\.xml$/); + const bytes = fs.readFileSync(path.join(root, asset.file)); + assert.equal( + createHash("sha256").update(bytes).digest("hex"), + asset.sha256, + ); } - assert.ok(files.length > 0); const text = files .map((file) => fs.readFileSync(file, "utf8")) .join("\n"); assert.equal(text.includes("synthetic-private-output"), false); - return { directory, artifact, files, text }; + assert.ok( + files.length || result.errors.length, + "Missing native evidence must remain an error", + ); + const retained = fs + .readdirSync(root, { recursive: true }) + .filter((file) => fs.statSync(path.join(root, file)).isFile()) + .sort(); + assert.deepEqual( + retained, + ["result.json", ...result.assets.map((asset) => asset.file)].sort(), + ); + return { directory: root, artifact, files, text, result }; }); } - - async readComments(title) { - const pullRequest = this.context.payload.pull_request; - if ( - this.context.eventName !== "pull_request" || - pullRequest.head.repo.full_name !== - `${this.context.repo.owner}/${this.context.repo.repo}` - ) - return null; - const comments = await this.github.paginate( - this.github.rest.issues.listComments, - { - ...this.context.repo, - issue_number: pullRequest.number, - per_page: 100, - }, + async discardFailures() { + const directory = process.env.EVIDENCE_DIRECTORY; + const count = fs + .readdirSync(directory, { recursive: true }) + .filter((file) => path.basename(file) === "result.json").length; + const reports = await this.read(count); + const artifacts = await this.github.paginate( + this.github.rest.actions.listWorkflowRunArtifacts, + { ...this.context.repo, run_id: this.context.runId, per_page: 100 }, ); - return comments - .filter( - (item) => - item.user.login === "github-actions[bot]" && - item.body.startsWith(`${title}\n`), - ) - .map(({ id, body, updated_at }) => ({ id, body, updated_at })); - } - - async comment(title) { - const comments = await this.readComments(title); - if (comments === null) return null; - assert.ok(comments.length > 0, `Missing comment: ${title}`); - for (const comment of comments) - assert.equal(comment.body.includes("synthetic-private-output"), false); - return comments[0].body; + for (const { result } of reports.filter( + ({ result }) => result.outcome !== "success" || result.errors.length, + )) { + const names = [ + `ci-report-v2-result-${result.id}`, + `ci-report-v2-registration-${result.id}`, + ]; + const owned = artifacts.filter((artifact) => + names.includes(artifact.name), + ); + assert.equal(owned.length, 2); + for (const artifact of owned) + await this.github.rest.actions.deleteArtifact({ + ...this.context.repo, + artifact_id: artifact.id, + }); + } } } - module.exports = { PublishedReports }; From ccb0106742eda9b2724b5fa6446858af839cf861 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 17:35:43 +0100 Subject: [PATCH 02/26] docs: regenerate native IaC report interfaces --- actions/ansible/test-molecule/README.md | 60 ++++++++------------- actions/ansible/test/README.md | 70 +++++++++---------------- actions/opentofu/test/README.md | 45 +++++++--------- actions/vm/create/README.md | 15 ++---- actions/vm/test/README.md | 67 +++++++++-------------- 5 files changed, 95 insertions(+), 162 deletions(-) diff --git a/actions/ansible/test-molecule/README.md b/actions/ansible/test-molecule/README.md index 55c729c..8649f75 100644 --- a/actions/ansible/test-molecule/README.md +++ b/actions/ansible/test-molecule/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: Ansible - Test Molecule -
- Ansible - Test Molecule -
- ---- - @@ -22,7 +16,7 @@ ## Overview -Run native Molecule scenarios with native reports, PR comments and artifacts. +Run molecule tests and retain validated native evidence for consolidated CI reporting. Run a native Molecule scenario and publish its Ansible task reports. @@ -40,7 +34,6 @@ Use [ansible/test](../test/README.md) for test playbooks and collection sanity. molecule-scenario: tests/molecule/default ansible-requirements: requirements.txt python-version-file: .python-version - report-name: Ansible integration tests ``` Supply a directory containing `molecule.yml` with @@ -86,18 +79,12 @@ a scenario targeting an externally created VM must not destroy it itself. ### Publish results -Native task reports and a scenario status report are collected after failures. -Only JUnit files are published; inventory, runtime state and installed tools remain -private. Reports contain task results: use synthetic data and `no_log` for private values. - -Hoverkraft's report actions publish summaries, annotations and stable PR comments. -Grant `pull-requests: write` for comments; fork PR comments are skipped. -Never run untrusted tests through `pull_request_target`. Choose distinct report -names for separate scenarios. Reports are uploaded with a unique artifact name -and seven-day retention, including after parsing or commenting failures. -For consolidated comments, set `comment: false` and call the common `ci-reports` -workflow after all test jobs. Native report artifacts use the `ci-reports-` prefix -and the current run attempt, so earlier attempts cannot leak stale results. +Only native test outcomes are retained; no execution-status test is invented. +Runtime state, inventory, installed tools and raw logs stay private. Native +assertion details are public: use synthetic data and no_log for private values. +Call common ci-reports once after all producers, then a separate CI complete +gate. Producers need contents: read and actions: read, without comment permissions. +Never execute untrusted tests via pull_request_target. @@ -105,7 +92,7 @@ and the current run attempt, so earlier attempts cannot leak stale results. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting with: # Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. # This input is required. @@ -124,14 +111,6 @@ and the current run attempt, so earlier attempts cannot leak stale results. # Native test sequence deadline, from 1 to 40 minutes. Interrupted runs allow two additional minutes for scenario cleanup. # Default: `20` test-timeout-minutes: "20" - - # Stable summary and PR comment title, distinct for each test step or matrix entry. - # Default: `Molecule test results` - report-name: Molecule test results - - # Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. - # Default: `true` - comment: "true" ``` @@ -139,20 +118,25 @@ and the current run attempt, so earlier attempts cannot leak stale results. ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ----------------------- | -| **`molecule-scenario`** | Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. | **true** | - | -| **`ansible-requirements`** | Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. | **true** | - | -| **`python-version-file`** | Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. | **false** | - | -| **`ansible-config`** | Optional checkout-relative ansible.cfg for scenario execution and collection search paths. | **false** | - | -| **`test-timeout-minutes`** | Native test sequence deadline, from 1 to 40 minutes. Interrupted runs allow two additional minutes for scenario cleanup. | **false** | `20` | -| **`report-name`** | Stable summary and PR comment title, distinct for each test step or matrix entry. | **false** | `Molecule test results` | -| **`comment`** | Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. | **false** | `true` | +| **Input** | **Description** | **Required** | **Default** | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ----------- | +| **`molecule-scenario`** | Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. | **true** | - | +| **`ansible-requirements`** | Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. | **true** | - | +| **`python-version-file`** | Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. | **false** | - | +| **`ansible-config`** | Optional checkout-relative ansible.cfg for scenario execution and collection search paths. | **false** | - | +| **`test-timeout-minutes`** | Native test sequence deadline, from 1 to 40 minutes. Interrupted runs allow two additional minutes for scenario cleanup. | **false** | `20` | + +## Outputs + +| **Output** | **Description** | +| ------------------------ | ------------------------------------------------------------------ | +| **`report-artifact-id`** | Native result artifact ID, discovered automatically by ci-reports. | + diff --git a/actions/ansible/test/README.md b/actions/ansible/test/README.md index db49e11..d4d8013 100644 --- a/actions/ansible/test/README.md +++ b/actions/ansible/test/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: Ansible - Test -
- Ansible - Test -
- ---- - @@ -22,7 +16,7 @@ ## Overview -Run Ansible test playbooks and collection sanity with native reports, PR comments and artifacts. +Run ansible tests and retain validated native evidence for consolidated CI reporting. Run Ansible tests with maintained upstream actions and native JUnit reports. @@ -69,46 +63,40 @@ collection job so native `tests/output/junit` contains only that run's reports. ### Publish results -Hoverkraft's `parse-ci-reports` publishes native JUnit as summaries, annotations -and a stable PR comment. Test output and task results appear in these reports; -use synthetic data suitable for the repository's visibility. The collection -action also publishes its own summary. - -Report collection runs after upstream failures, including when the upstream -action does not export its report output. Reports are uploaded with a unique -artifact name and seven-day retention, including after parsing or commenting -errors. Missing reports fail the action. Failed tests remain failures. No custom -test runner or Docker lifecycle is maintained here. - -Grant `pull-requests: write` for comments. Fork PR comments are skipped. -Never run untrusted tests through `pull_request_target`. Use distinct report names -for matrix entries. -For consolidated comments, set `comment: false` and call the common `ci-reports` -workflow after all test jobs. Native report artifacts use the `ci-reports-` prefix -and the current run attempt, so earlier attempts cannot leak stale results. +Native JUnit is validated and retained through common record-ci-reports. +Use synthetic expectations: native reports may contain assertion details. +Call ci-reports once after every producer and add a separate CI complete gate. +Producers need contents: read and actions: read, without comment permissions. +Upstream collection sanity owns its diagnostic summary. It does not create +the consolidated report or comment. Never use pull_request_target for tests. ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ---------------------- | -| **`ansible-requirements`** | Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. | **true** | - | -| **`test-playbook`** | Checkout-relative playbook containing test assertions. This playbook is executed. Supply test-playbook or collection, exclusively. | **false** | - | -| **`collection`** | One checked-out collection directory containing galaxy.yml. Use a matrix for multiple collections. | **false** | - | -| **`target-python-version`** | Optional Python major.minor for collection sanity checks. Empty tests all versions supported by Ansible Core. | **false** | - | -| **`sanity-image`** | Optional pinned Docker image for collection sanity. Requires target-python-version; empty uses Ansible Core's default image and Python matrix. | **false** | - | -| **`python-version-file`** | Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. | **false** | - | -| **`ansible-config`** | Optional checkout-relative ansible.cfg file for test playbook execution. | **false** | - | -| **`galaxy-requirements`** | Optional checkout-relative Galaxy requirements file for third-party role and collection dependencies. | **false** | - | -| **`report-name`** | Stable summary and PR comment title, distinct for each test step or matrix entry. | **false** | `Ansible test results` | -| **`comment`** | Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. | **false** | `true` | +| **Input** | **Description** | **Required** | **Default** | +| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ----------- | +| **`ansible-requirements`** | Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. | **true** | - | +| **`test-playbook`** | Checkout-relative playbook containing test assertions. This playbook is executed. Supply test-playbook or collection, exclusively. | **false** | - | +| **`collection`** | One checked-out collection directory containing galaxy.yml. Use a matrix for multiple collections. | **false** | - | +| **`target-python-version`** | Optional Python major.minor for collection sanity checks. Empty tests all versions supported by Ansible Core. | **false** | - | +| **`sanity-image`** | Optional pinned Docker image for collection sanity. Requires target-python-version; empty uses Ansible Core's default image and Python matrix. | **false** | - | +| **`python-version-file`** | Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. | **false** | - | +| **`ansible-config`** | Optional checkout-relative ansible.cfg file for test playbook execution. | **false** | - | +| **`galaxy-requirements`** | Optional checkout-relative Galaxy requirements file for third-party role and collection dependencies. | **false** | - | + +## Outputs + +| **Output** | **Description** | +| ------------------------ | ------------------------------------------------------------------ | +| **`report-artifact-id`** | Native result artifact ID, discovered automatically by ci-reports. | + @@ -146,7 +134,7 @@ This documentation was automatically generated by [CI Dokumentor](https://github ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting with: # Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. # This input is required. @@ -172,14 +160,6 @@ This documentation was automatically generated by [CI Dokumentor](https://github # Optional checkout-relative Galaxy requirements file for third-party role and collection dependencies. galaxy-requirements: "" - - # Stable summary and PR comment title, distinct for each test step or matrix entry. - # Default: `Ansible test results` - report-name: Ansible test results - - # Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. - # Default: `true` - comment: "true" ``` diff --git a/actions/opentofu/test/README.md b/actions/opentofu/test/README.md index 5a88f58..7c74f1e 100644 --- a/actions/opentofu/test/README.md +++ b/actions/opentofu/test/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: OpenTofu - Test -
- OpenTofu - Test -
- ---- - @@ -22,7 +16,7 @@ ## Overview -Run native OpenTofu tests with the official runtime, summaries, JUnit artifacts and optional PR comments. +Run opentofu tests and retain validated native evidence for consolidated CI reporting. Run native OpenTofu tests and publish their results through Hoverkraft reporting. @@ -45,10 +39,12 @@ variable values and raw event streams are never uploaded. Failures, empty suites incomplete reports and cleanup errors remain failures. Use synthetic fixtures; test names and filenames are public report metadata. -Reports are parsed as summaries and annotations and retained for seven days, -including after test failures. Set `comment: false` with the common `ci-reports` -workflow to consolidate results. Individual comments require `pull-requests: write` -and are skipped for fork PRs. Never execute untrusted tests via pull_request_target. +Only native test outcomes are retained; no execution-status test is invented. +Runtime state, inventory, installed tools and raw logs stay private. Native +assertion details are public: use synthetic data and no_log for private values. +Call common ci-reports once after all producers, then a separate CI complete +gate. Producers need contents: read and actions: read, without comment permissions. +Never execute untrusted tests via pull_request_target. @@ -56,7 +52,7 @@ and are skipped for fork PRs. Never execute untrusted tests via pull_request_tar ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting with: # Checkout-relative module directory containing native OpenTofu tests. # This input is required. @@ -65,14 +61,6 @@ and are skipped for fork PRs. Never execute untrusted tests via pull_request_tar # Checkout-relative file containing an exact stable OpenTofu version maintained by the consumer. # This input is required. tofu-version-file: "" - - # Stable report title, distinct for each test step or matrix entry. - # Default: `OpenTofu test results` - report-name: OpenTofu test results - - # Publish an individual PR comment. Set false when using the shared ci-reports workflow. - # Default: `true` - comment: "true" ``` @@ -80,17 +68,22 @@ and are skipped for fork PRs. Never execute untrusted tests via pull_request_tar ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| ----------------------- | ---------------------------------------------------------------------------------------------- | ------------ | ----------------------- | -| **`working-directory`** | Checkout-relative module directory containing native OpenTofu tests. | **true** | - | -| **`tofu-version-file`** | Checkout-relative file containing an exact stable OpenTofu version maintained by the consumer. | **true** | - | -| **`report-name`** | Stable report title, distinct for each test step or matrix entry. | **false** | `OpenTofu test results` | -| **`comment`** | Publish an individual PR comment. Set false when using the shared ci-reports workflow. | **false** | `true` | +| **Input** | **Description** | **Required** | **Default** | +| ----------------------- | ---------------------------------------------------------------------------------------------- | ------------ | ----------- | +| **`working-directory`** | Checkout-relative module directory containing native OpenTofu tests. | **true** | - | +| **`tofu-version-file`** | Checkout-relative file containing an exact stable OpenTofu version maintained by the consumer. | **true** | - | + +## Outputs + +| **Output** | **Description** | +| ------------------------ | ------------------------------------------------------------------ | +| **`report-artifact-id`** | Native result artifact ID, discovered automatically by ci-reports. | + diff --git a/actions/vm/create/README.md b/actions/vm/create/README.md index 0a47ddd..8395f10 100644 --- a/actions/vm/create/README.md +++ b/actions/vm/create/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItc2VydmVyIiBjb2xvcj0icHVycGxlIj48cmVjdCB4PSIyIiB5PSIyIiB3aWR0aD0iMjAiIGhlaWdodD0iOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PHJlY3QgeD0iMiIgeT0iMTQiIHdpZHRoPSIyMCIgaGVpZ2h0PSI4IiByeD0iMiIgcnk9IjIiPjwvcmVjdD48bGluZSB4MT0iNiIgeTE9IjYiIHgyPSI2LjAxIiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI2IiB5MT0iMTgiIHgyPSI2LjAxIiB5Mj0iMTgiPjwvbGluZT48L3N2Zz4=) GitHub Action: VM - Create -
- VM - Create -
- ---- - @@ -47,7 +41,6 @@ After checkout, supply your VM configuration and a with: vm: ${{ steps.vm.outputs.vm }} goss-file: tests/goss.yaml - report-name: Infrastructure VM tests - name: Destroy VM if: ${{ always() && steps.vm.outputs.vm != '' }} uses: hoverkraft-tech/ci-github-iac/actions/vm/destroy@ @@ -61,9 +54,9 @@ check deployment, idempotence and reboot against the same VM. Reference the creation step's `name` and `ssh-config` outputs in that scenario's inventory; Molecule's target and sequence are configured by the scenario. -Default GitHub reporting needs `pull-requests: write` for PR comments. Other -reporting modes and permissions are documented by `vm/test`. The maintained -[VM test workflow](../../../.github/workflows/__test-actions-vm-test.yml) also +Call common `ci-reports` once after all producers to publish the consolidated +report, then use a separate `CI complete` gate. Producers need `actions: read`. +The maintained [VM test workflow](../../../.github/workflows/__test-actions-vm-test.yml) also covers failures and repeated tests. No consumer Makefile is required. ### Runner and configuration @@ -172,7 +165,7 @@ configuration private. `vm/test` uses it internally to open fresh guest logins. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/create@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/vm/create@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting with: # Creation backend, lima (default) or qemu. Testing and cleanup use the returned vm reference without another backend choice. # Default: `lima` diff --git a/actions/vm/test/README.md b/actions/vm/test/README.md index 3e45de0..2a70f6c 100644 --- a/actions/vm/test/README.md +++ b/actions/vm/test/README.md @@ -2,12 +2,6 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: VM - Test -
- VM - Test -
- ---- - @@ -22,7 +16,7 @@ ## Overview -Validate VM state with Goss, publish summaries and PR comments, and upload JUnit results. +Run vm tests and retain validated native evidence for consolidated CI reporting. Validate a disposable Linux VM with Goss and publish JUnit results. @@ -52,25 +46,17 @@ report, a nonempty regular file up to 20 MiB. Missing, empty and fully skipped suites fail. Reports are collected after failed assertions; private guest test files are then removed. Incomplete transfers are never published. -### Publish results - -Each invocation publishes native JUnit plus a sanitized execution-status report -through Hoverkraft's report parser: job summary, annotations and, on eligible -pull requests, an updated comment. Use a distinct stable `report-name` for each -step and matrix scenario. Comments use `github.token` and require -`pull-requests: write`; fork PRs still receive summaries and artifacts. -Do not use `pull_request_target` to execute untrusted suites. - -Completed reports are retained as a unique GitHub artifact for seven days, even -after parser or comment failure. Raw command output and exceptions are excluded -from the execution-status report. Native Goss reports retain assertion details: -use synthetic expectations and never match or print credentials. Infrastructure -assertions produce test results, not application code coverage. +### Retain results -See the [lifecycle example](../create/README.md#compose-the-vm-actions). -For consolidated comments, set `comment: false` and call the common `ci-reports` -workflow after all test jobs. Native report artifacts use the `ci-reports-` prefix -and the current run attempt, so earlier attempts cannot leak stale results. +Each invocation registers its expected native Goss JUnit report before testing, +then validates and retains it even after assertion failures. No synthetic test +case is added for execution status. VM cleanup stays with the caller. +Native assertion details are public: never match or print credentials. +Infrastructure assertions produce test results, not application code coverage. +Call common ci-reports once after all test jobs. Producers need contents: read +and actions: read; comments and summaries belong to the reporting workflow. +Use a separate CI complete gate for all required jobs and reporting. +Never use pull_request_target to execute untrusted suites. @@ -78,7 +64,7 @@ and the current run attempt, so earlier attempts cannot leak stale results. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting with: # VM reference returned by vm/create in the same job; works with either backend. # This input is required. @@ -94,14 +80,6 @@ and the current run attempt, so earlier attempts cannot leak stale results. # Combined Goss setup and execution timeout, from 1 to 40 minutes. # Default: `10` test-timeout-minutes: "10" - - # Summary and PR comment title. Use a distinct stable name for each test step and matrix scenario. - # Default: `VM test results` - report-name: VM test results - - # Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. - # Default: `true` - comment: "true" ``` @@ -109,19 +87,24 @@ and the current run attempt, so earlier attempts cannot leak stale results. ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------------- | -| **`vm`** | VM reference returned by vm/create in the same job; works with either backend. | **true** | - | -| **`goss-file`** | Required checkout-relative Goss suite, including any referenced Goss files. | **true** | - | -| **`goss-vars`** | Optional checkout-relative JSON or YAML variables file. Use values suitable for public reports. | **false** | - | -| **`test-timeout-minutes`** | Combined Goss setup and execution timeout, from 1 to 40 minutes. | **false** | `10` | -| **`report-name`** | Summary and PR comment title. Use a distinct stable name for each test step and matrix scenario. | **false** | `VM test results` | -| **`comment`** | Publish an individual PR comment. Set false when using the shared ci-reports workflow; summaries, annotations and artifacts remain enabled. | **false** | `true` | +| **Input** | **Description** | **Required** | **Default** | +| -------------------------- | ----------------------------------------------------------------------------------------------- | ------------ | ----------- | +| **`vm`** | VM reference returned by vm/create in the same job; works with either backend. | **true** | - | +| **`goss-file`** | Required checkout-relative Goss suite, including any referenced Goss files. | **true** | - | +| **`goss-vars`** | Optional checkout-relative JSON or YAML variables file. Use values suitable for public reports. | **false** | - | +| **`test-timeout-minutes`** | Combined Goss setup and execution timeout, from 1 to 40 minutes. | **false** | `10` | + +## Outputs + +| **Output** | **Description** | +| ------------------------ | ------------------------------------------------------------------ | +| **`report-artifact-id`** | Native result artifact ID, discovered automatically by ci-reports. | + From b284353ef681dfc517e745ce6e774698d0873935 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 18:04:03 +0100 Subject: [PATCH 03/26] fix: validate native infrastructure reports through the shared contract --- .../actions/retain-native-reports/action.yml | 2 +- .github/workflows/__main-ci.yml | 3 +- .github/workflows/__pull-request-ci.yml | 3 +- .github/workflows/__release.yml | 3 +- .github/workflows/__shared-ci.yml | 14 ++++----- .../__test-actions-ansible-test-molecule.yml | 30 +++++++++++++------ .../workflows/__test-actions-ansible-test.yml | 14 ++++++--- .../__test-actions-opentofu-test.yml | 14 ++++++--- .../workflows/__test-actions-vm-create.yml | 2 +- .../workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 16 ++++++---- CONTRIBUTING.md | 6 ++++ actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test-molecule/package.json | 2 +- actions/ansible/test/README.md | 4 +-- actions/ansible/test/action.yml | 4 +-- actions/ansible/test/package.json | 2 +- actions/opentofu/test/action.yml | 2 +- actions/opentofu/test/package.json | 2 +- actions/vm/create/package.json | 2 +- actions/vm/destroy/package.json | 2 +- actions/vm/test/action.yml | 2 +- actions/vm/test/package.json | 2 +- tests/helpers/published-reports.cjs | 28 ++++------------- 24 files changed, 92 insertions(+), 71 deletions(-) diff --git a/.github/actions/retain-native-reports/action.yml b/.github/actions/retain-native-reports/action.yml index e037ca7..bd5eb4d 100644 --- a/.github/actions/retain-native-reports/action.yml +++ b/.github/actions/retain-native-reports/action.yml @@ -33,7 +33,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: operation: finalize recording: ${{ inputs.recording }} diff --git a/.github/workflows/__main-ci.yml b/.github/workflows/__main-ci.yml index 9b17873..483d881 100644 --- a/.github/workflows/__main-ci.yml +++ b/.github/workflows/__main-ci.yml @@ -23,8 +23,9 @@ jobs: name: Continuous Integration uses: $/.github/workflows/__shared-ci.yml permissions: + id-token: write code-quality: write - actions: write + actions: read contents: read issues: write packages: read diff --git a/.github/workflows/__pull-request-ci.yml b/.github/workflows/__pull-request-ci.yml index 3a6b7d2..8e3986a 100644 --- a/.github/workflows/__pull-request-ci.yml +++ b/.github/workflows/__pull-request-ci.yml @@ -19,8 +19,9 @@ jobs: name: Continuous Integration uses: $/.github/workflows/__shared-ci.yml permissions: + id-token: write code-quality: write - actions: write + actions: read contents: read issues: write packages: read diff --git a/.github/workflows/__release.yml b/.github/workflows/__release.yml index 0027c3c..a9c64f4 100644 --- a/.github/workflows/__release.yml +++ b/.github/workflows/__release.yml @@ -24,8 +24,9 @@ jobs: if: github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch uses: $/.github/workflows/__shared-ci.yml permissions: + id-token: write code-quality: write - actions: write + actions: read contents: read issues: write packages: read diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index c1d9e67..ae28af5 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -27,7 +27,7 @@ jobs: uses: $/.github/workflows/__test-actions-vm-create.yml test-vm-test: permissions: - actions: write + actions: read contents: read pull-requests: write uses: $/.github/workflows/__test-actions-vm-test.yml @@ -38,19 +38,19 @@ jobs: uses: $/.github/workflows/__test-actions-vm-destroy.yml test-ansible: permissions: - actions: write + actions: read contents: read pull-requests: write uses: $/.github/workflows/__test-actions-ansible-test.yml test-molecule: permissions: - actions: write + actions: read contents: read pull-requests: write uses: $/.github/workflows/__test-actions-ansible-test-molecule.yml test-opentofu: permissions: - actions: write + actions: read contents: read pull-requests: write uses: $/.github/workflows/__test-actions-opentofu-test.yml @@ -65,7 +65,7 @@ jobs: - test-ansible - test-molecule - test-opentofu - 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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) permissions: actions: read contents: read @@ -94,6 +94,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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index b3f2387..94301b1 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 12 permissions: - actions: write + actions: read contents: read strategy: fail-fast: false @@ -55,12 +55,13 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 if: ${{ !cancelled() }} - name: Assert - Require native reports and scenario cleanup + id: verify-ansible-test-molecule-local if: ${{ always() }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: @@ -79,14 +80,19 @@ jobs: const [report] = await published.read(1); assert.ok(report.files.every(file => !file.endsWith('/scenario.xml'))); assert.equal(report.result.outcome, expected); - await published.discardFailures(); + core.setOutput('negative-fixtures', await published.negativeFixtures()); + - name: Cleanup - Discard ansible-test-molecule local negative results + if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: runs-on: ubuntu-latest timeout-minutes: 25 # Keep fixture setup visible in each action's dedicated workflow. # jscpd:ignore-start permissions: - actions: write + actions: read contents: read steps: - name: Arrange - Checkout fixture @@ -128,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -160,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -192,12 +198,13 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 if: ${{ !cancelled() }} - name: Assert - Check Molecule idempotence failure and reports + id: verify-ansible-test-molecule-vm if: ${{ !cancelled() && steps.vm.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: @@ -210,7 +217,12 @@ jobs: const published = new PublishedReports(github, context); assert.equal(process.env.IDEMPOTENCE_FAILURE, 'failure'); await published.read(3); - await published.discardFailures(); + core.setOutput('negative-fixtures', await published.negativeFixtures()); + - name: Cleanup - Discard ansible-test-molecule vm negative results + if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. # jscpd:ignore-start - name: Cleanup - Destroy direct QEMU guest diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 1373a22..a1ed262 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - actions: write + actions: read contents: read strategy: fail-fast: false @@ -73,12 +73,13 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 if: ${{ !cancelled() }} - name: Assert - Verify check outcomes and native reports + id: verify-ansible-test-scenarios if: ${{ always() }} env: EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 @@ -94,4 +95,9 @@ jobs: const [report] = await published.read(1); assert.ok(report.files.every(file => file.endsWith('.xml'))); assert.equal(/<(?:failure|error)\b/.test(report.text), process.env.EXPECTED === 'failure'); - await published.discardFailures(); + core.setOutput('negative-fixtures', await published.negativeFixtures()); + - name: Cleanup - Discard ansible-test scenarios negative results + if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index e45aa17..2f4d756 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 permissions: - actions: write + actions: read contents: read strategy: fail-fast: false @@ -59,12 +59,13 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 if: ${{ !cancelled() }} - name: Assert - Verify outcomes and retained safe reports + id: verify-opentofu-test-scenarios if: ${{ always() }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: @@ -86,4 +87,9 @@ jobs: if (success) { assert.match(report.text, /apply_and_read/); } - await published.discardFailures(); + core.setOutput('negative-fixtures', await published.negativeFixtures()); + - name: Cleanup - Discard opentofu-test scenarios negative results + if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 2607b83..6ced0ed 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index 29f2fdf..3e34095 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 64273a3..1629abf 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@64899fdf0e6164bf96c679ed574b5c9cd13f2a99 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 25 permissions: - actions: write + actions: read contents: read strategy: fail-fast: false @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,12 +128,13 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c0b651dd3d5f9ce5eff49c3c675c1f5c7f2ca581 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 if: ${{ !cancelled() }} - name: Assert - Check failed suites and independent native artifacts + id: verify-vm-test-guest if: ${{ !cancelled() && steps.vm.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: @@ -152,7 +153,12 @@ jobs: const reports = await published.read(4); assert.equal(reports.filter(report => report.result.outcome === 'failure').length, 3); assert.ok(reports.some(report => report.text.includes('iac-missing-synthetic-file'))); - await published.discardFailures(); + core.setOutput('negative-fixtures', await published.negativeFixtures()); + - name: Cleanup - Discard vm-test guest negative results + if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM if: ${{ always() && steps.vm.outputs.vm != '' }} uses: $/actions/vm/destroy diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 122e119..9b347b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -307,3 +307,9 @@ The safety-only helper in `actions/_internal/native-reports.cjs` stages regular XML files into fresh recorder storage. It never retains environment directories, VM state, secrets or raw command logs. Each action keeps resource cleanup in its existing lifecycle, including after execution and reporting failures. + +Shared VM command and workspace helpers are measured by `vm/create`; runtime +ownership and cleanup are measured by `vm/destroy`. The native report staging +helper is measured by `vm/test`. Other suites still test shared behavior without +submitting overlapping primary coverage for those same files. Explicit exclusions +keep maintained code in action directories named `test` measurable on Node 24. diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 577e8a3..272afb7 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test-molecule/package.json b/actions/ansible/test-molecule/package.json index 1804705..9388fb1 100644 --- a/actions/ansible/test-molecule/package.json +++ b/actions/ansible/test-molecule/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "node --test", - "test:ci": "node --test-coverage-include='**/actions/ansible/test-molecule/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/ansible/test/README.md b/actions/ansible/test/README.md index d4d8013..af50340 100644 --- a/actions/ansible/test/README.md +++ b/actions/ansible/test/README.md @@ -16,7 +16,7 @@ ## Overview -Run ansible tests and retain validated native evidence for consolidated CI reporting. +Run Ansible tests and retain validated native evidence for consolidated CI reporting. Run Ansible tests with maintained upstream actions and native JUnit reports. @@ -134,7 +134,7 @@ This documentation was automatically generated by [CI Dokumentor](https://github ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@ccb0106742eda9b2724b5fa6446858af839cf861 # refactor/unified-ci-reporting with: # Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. # This input is required. diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index 6bd4648..b345470 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -51,7 +51,7 @@ # the consolidated report or comment. Never use pull_request_target for tests. --- name: Ansible - Test -description: Run ansible tests and retain validated native evidence for consolidated CI reporting. +description: Run Ansible tests and retain validated native evidence for consolidated CI reporting. author: Hoverkraft branding: icon: check-circle @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/ansible/test/package.json b/actions/ansible/test/package.json index 83c7d7d..c9cfe6a 100644 --- a/actions/ansible/test/package.json +++ b/actions/ansible/test/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "node --test", - "test:ci": "node --test-coverage-include='**/actions/ansible/test/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/glob": "0.7.0" diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 019b32b..e52f446 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/opentofu/test/package.json b/actions/opentofu/test/package.json index 48f50b4..31898e6 100644 --- a/actions/opentofu/test/package.json +++ b/actions/opentofu/test/package.json @@ -9,6 +9,6 @@ }, "scripts": { "test": "node --test", - "test:ci": "node --test-coverage-include='**/actions/opentofu/test/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" } } diff --git a/actions/vm/create/package.json b/actions/vm/create/package.json index bbde306..c506dc8 100644 --- a/actions/vm/create/package.json +++ b/actions/vm/create/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "node --test", - "test:ci": "node --test-coverage-include='**/actions/vm/create/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-coverage-include='../_internal/command.cjs' --test-coverage-include='../_internal/workspace.cjs' --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/vm/destroy/package.json b/actions/vm/destroy/package.json index ceaa7c6..c49f243 100644 --- a/actions/vm/destroy/package.json +++ b/actions/vm/destroy/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "node --test", - "test:ci": "node --test-coverage-include='**/actions/vm/destroy/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='../_internal/runtime.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 83a96fb..3ea34e7 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) - name: Run Goss assertions id: test diff --git a/actions/vm/test/package.json b/actions/vm/test/package.json index 9a5a7d4..b993e18 100644 --- a/actions/vm/test/package.json +++ b/actions/vm/test/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "node --test", - "test:ci": "node --test-coverage-include='**/actions/vm/test/**' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-coverage-include='../../_internal/native-reports.cjs' --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/tests/helpers/published-reports.cjs b/tests/helpers/published-reports.cjs index ac6cdd4..7028145 100644 --- a/tests/helpers/published-reports.cjs +++ b/tests/helpers/published-reports.cjs @@ -58,33 +58,15 @@ class PublishedReports { return { directory: root, artifact, files, text, result }; }); } - async discardFailures() { + async negativeFixtures() { const directory = process.env.EVIDENCE_DIRECTORY; const count = fs .readdirSync(directory, { recursive: true }) .filter((file) => path.basename(file) === "result.json").length; - const reports = await this.read(count); - const artifacts = await this.github.paginate( - this.github.rest.actions.listWorkflowRunArtifacts, - { ...this.context.repo, run_id: this.context.runId, per_page: 100 }, - ); - for (const { result } of reports.filter( - ({ result }) => result.outcome !== "success" || result.errors.length, - )) { - const names = [ - `ci-report-v2-result-${result.id}`, - `ci-report-v2-registration-${result.id}`, - ]; - const owned = artifacts.filter((artifact) => - names.includes(artifact.name), - ); - assert.equal(owned.length, 2); - for (const artifact of owned) - await this.github.rest.actions.deleteArtifact({ - ...this.context.repo, - artifact_id: artifact.id, - }); - } + return (await this.read(count)) + .filter(({ result }) => result.outcome !== "success") + .map(({ artifact }) => artifact.id) + .join(","); } } module.exports = { PublishedReports }; From d082b20d64d708e9d9838b9abc904ae163e176cc Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 18:06:36 +0100 Subject: [PATCH 04/26] ci: validate the final shared reporting contract --- .github/actions/retain-native-reports/action.yml | 2 +- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 14 +++++++------- .github/workflows/__test-actions-ansible-test.yml | 6 +++--- .github/workflows/__test-actions-opentofu-test.yml | 6 +++--- .github/workflows/__test-actions-vm-create.yml | 2 +- .github/workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 8 ++++---- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/vm/test/action.yml | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/actions/retain-native-reports/action.yml b/.github/actions/retain-native-reports/action.yml index bd5eb4d..00ae60a 100644 --- a/.github/actions/retain-native-reports/action.yml +++ b/.github/actions/retain-native-reports/action.yml @@ -33,7 +33,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: operation: finalize recording: ${{ inputs.recording }} diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index ae28af5..d0ada80 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -65,7 +65,7 @@ jobs: - test-ansible - test-molecule - test-opentofu - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) permissions: actions: read contents: read @@ -94,6 +94,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@24f2afc2ecc7a7a70021600055217d25fc102f88 # 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-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 94301b1..0c45637 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index a1ed262..00f8a78 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 2f4d756..036d019 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 6ced0ed..f95a4e7 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # 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-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index 3e34095..6a66c60 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # 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-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 1629abf..3f256c1 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@be526fc1367b1e06482052d80e449c063fb7507c # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 272afb7..73b40ac 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index b345470..d3d3fd1 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index e52f446..221eb08 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 3ea34e7..805a105 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@24f2afc2ecc7a7a70021600055217d25fc102f88 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) - name: Run Goss assertions id: test From 39e8b417d354406267227ba1038079cf7435d646 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 18:10:59 +0100 Subject: [PATCH 05/26] ci: remove obsolete test comment permissions --- .github/workflows/__shared-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index d0ada80..54118ba 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -29,7 +29,6 @@ jobs: permissions: actions: read contents: read - pull-requests: write uses: $/.github/workflows/__test-actions-vm-test.yml test-vm-destroy: permissions: @@ -40,19 +39,16 @@ jobs: permissions: actions: read contents: read - pull-requests: write uses: $/.github/workflows/__test-actions-ansible-test.yml test-molecule: permissions: actions: read contents: read - pull-requests: write uses: $/.github/workflows/__test-actions-ansible-test-molecule.yml test-opentofu: permissions: actions: read contents: read - pull-requests: write uses: $/.github/workflows/__test-actions-opentofu-test.yml reports: From 35cb78606b190fe8b95542306f788e0b3c35ad16 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 28 Nov 2026 18:12:00 +0100 Subject: [PATCH 06/26] docs: preserve branding in generated action references --- actions/ansible/test-molecule/README.md | 6 ++++++ actions/ansible/test/README.md | 6 ++++++ actions/opentofu/test/README.md | 6 ++++++ actions/vm/create/README.md | 6 ++++++ actions/vm/test/README.md | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/actions/ansible/test-molecule/README.md b/actions/ansible/test-molecule/README.md index 8649f75..9207edf 100644 --- a/actions/ansible/test-molecule/README.md +++ b/actions/ansible/test-molecule/README.md @@ -2,6 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: Ansible - Test Molecule +
+ Ansible - Test Molecule +
+ +--- + diff --git a/actions/ansible/test/README.md b/actions/ansible/test/README.md index af50340..7e51ec5 100644 --- a/actions/ansible/test/README.md +++ b/actions/ansible/test/README.md @@ -2,6 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: Ansible - Test +
+ Ansible - Test +
+ +--- + diff --git a/actions/opentofu/test/README.md b/actions/opentofu/test/README.md index 7c74f1e..f0c7971 100644 --- a/actions/opentofu/test/README.md +++ b/actions/opentofu/test/README.md @@ -2,6 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: OpenTofu - Test +
+ OpenTofu - Test +
+ +--- + diff --git a/actions/vm/create/README.md b/actions/vm/create/README.md index 8395f10..44b2c89 100644 --- a/actions/vm/create/README.md +++ b/actions/vm/create/README.md @@ -2,6 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItc2VydmVyIiBjb2xvcj0icHVycGxlIj48cmVjdCB4PSIyIiB5PSIyIiB3aWR0aD0iMjAiIGhlaWdodD0iOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PHJlY3QgeD0iMiIgeT0iMTQiIHdpZHRoPSIyMCIgaGVpZ2h0PSI4IiByeD0iMiIgcnk9IjIiPjwvcmVjdD48bGluZSB4MT0iNiIgeTE9IjYiIHgyPSI2LjAxIiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI2IiB5MT0iMTgiIHgyPSI2LjAxIiB5Mj0iMTgiPjwvbGluZT48L3N2Zz4=) GitHub Action: VM - Create +
+ VM - Create +
+ +--- + diff --git a/actions/vm/test/README.md b/actions/vm/test/README.md index 2a70f6c..0d20bcf 100644 --- a/actions/vm/test/README.md +++ b/actions/vm/test/README.md @@ -2,6 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: VM - Test +
+ VM - Test +
+ +--- + From fbbfb1688f74410781466572ac7facd1f1c8d2ec Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 09:46:43 +0100 Subject: [PATCH 07/26] fix(ci): adopt external coverage comment ownership --- .github/actions/retain-native-reports/action.yml | 2 +- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 12 ++++++------ .github/workflows/__test-actions-ansible-test.yml | 4 ++-- .github/workflows/__test-actions-opentofu-test.yml | 4 ++-- .github/workflows/__test-actions-vm-test.yml | 6 +++--- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/vm/test/action.yml | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/actions/retain-native-reports/action.yml b/.github/actions/retain-native-reports/action.yml index 00ae60a..2fd7d4e 100644 --- a/.github/actions/retain-native-reports/action.yml +++ b/.github/actions/retain-native-reports/action.yml @@ -33,7 +33,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.recording }} diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 54118ba..72239fa 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -61,7 +61,7 @@ jobs: - test-ansible - test-molecule - test-opentofu - 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/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 0c45637..7a6ed4d 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 00f8a78..60f8a38 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 036d019..2951f9a 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 3f256c1..45800b0 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@a0bdfab27afed208f3c105e4b543818b8388b80b # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 73b40ac..63aee10 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index d3d3fd1..13a9fd7 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 221eb08..bc4a2ac 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 805a105..ea6834c 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Run Goss assertions id: test From bea07b0e6cf85037102530c83a648dc7c7f55237 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 11:12:18 +0100 Subject: [PATCH 08/26] ci: adopt actionable reports and stable coverage project flags --- .github/actions/retain-native-reports/action.yml | 2 +- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 12 ++++++------ .github/workflows/__test-actions-ansible-test.yml | 4 ++-- .github/workflows/__test-actions-opentofu-test.yml | 4 ++-- .github/workflows/__test-actions-vm-test.yml | 6 +++--- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/vm/test/action.yml | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/actions/retain-native-reports/action.yml b/.github/actions/retain-native-reports/action.yml index 2fd7d4e..7d8f90e 100644 --- a/.github/actions/retain-native-reports/action.yml +++ b/.github/actions/retain-native-reports/action.yml @@ -33,7 +33,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.recording }} diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 72239fa..0f906b6 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -61,7 +61,7 @@ jobs: - test-ansible - test-molecule - test-opentofu - 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/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 7a6ed4d..d85be55 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 60f8a38..67f4a69 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 2951f9a..c71c392 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 45800b0..4426091 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@4043eb6a440b21812c3d92d78bd6d019713326b2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 63aee10..427dc22 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index 13a9fd7..c37a9af 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index bc4a2ac..29278da 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index ea6834c..a74021b 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Run Goss assertions id: test From c0bf7e044ef979871e12d3a1274b49083d8a7f84 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 11:21:58 +0100 Subject: [PATCH 09/26] ci: update validated reporting implementation --- .github/actions/retain-native-reports/action.yml | 2 +- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 12 ++++++------ .github/workflows/__test-actions-ansible-test.yml | 4 ++-- .github/workflows/__test-actions-opentofu-test.yml | 4 ++-- .github/workflows/__test-actions-vm-test.yml | 6 +++--- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/vm/test/action.yml | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/actions/retain-native-reports/action.yml b/.github/actions/retain-native-reports/action.yml index 7d8f90e..955acd5 100644 --- a/.github/actions/retain-native-reports/action.yml +++ b/.github/actions/retain-native-reports/action.yml @@ -33,7 +33,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.recording }} diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 0f906b6..e893561 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -61,7 +61,7 @@ jobs: - test-ansible - test-molecule - test-opentofu - 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/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index d85be55..8af3e37 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 67f4a69..1ee7809 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index c71c392..0699110 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 4426091..764d953 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@2a3dd6d8dd3627bd074c5dfe3228500be6b08892 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 427dc22..851aba6 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index c37a9af..b369178 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 29278da..0146971 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index a74021b..6f2a60c 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Run Goss assertions id: test From 6ae8613fbf39c36c460229c0644cdce603e71f0d Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 16:28:00 +0100 Subject: [PATCH 10/26] docs: correct release summary credential --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b347b7..21e4c8b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,7 +157,8 @@ gh workflow run __release.yml --ref main ``` The release job authenticates with `CI_BOT_APP_CLIENT_ID` and -`CI_BOT_APP_PRIVATE_KEY`; `OPENAI_API_KEY` supplies release-summary generation. +`CI_BOT_APP_PRIVATE_KEY`; `CHANGELOG_SUMMARY` supplies the JSON provider +configuration for release-summary generation. These values can be provided through organization variables and secrets. The app needs repository contents write and pull request read permissions for publication. Its token allows the resulting tag push to trigger main CI. From c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 19:21:32 +0100 Subject: [PATCH 11/26] refactor: keep native report retention under actions --- .github/workflows/__shared-ci.yml | 14 ++- .../__test-actions-ansible-test-molecule.yml | 12 +- .../workflows/__test-actions-ansible-test.yml | 4 +- .../__test-actions-opentofu-test.yml | 4 +- .../__test-actions-retain-native-reports.yml | 72 ++++++++++++ .github/workflows/__test-actions-vm-test.yml | 6 +- CONTRIBUTING.md | 6 +- README.md | 6 + actions/ansible/test-molecule/README.md | 2 +- actions/ansible/test-molecule/action.yml | 4 +- actions/ansible/test/README.md | 2 +- actions/ansible/test/action.yml | 4 +- actions/opentofu/test/README.md | 2 +- actions/opentofu/test/action.yml | 4 +- actions/retain-native-reports/README.md | 109 ++++++++++++++++++ .../retain-native-reports/action.yml | 10 +- actions/vm/create/README.md | 2 +- actions/vm/test/README.md | 2 +- actions/vm/test/action.yml | 4 +- 19 files changed, 237 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/__test-actions-retain-native-reports.yml create mode 100644 actions/retain-native-reports/README.md rename {.github/actions => actions}/retain-native-reports/action.yml (82%) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index e893561..e431b03 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -51,6 +51,12 @@ jobs: contents: read uses: $/.github/workflows/__test-actions-opentofu-test.yml + test-retain-native-reports: + permissions: + actions: read + contents: read + uses: $/.github/workflows/__test-actions-retain-native-reports.yml + reports: if: always() needs: @@ -61,7 +67,8 @@ jobs: - test-ansible - test-molecule - test-opentofu - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + - test-retain-native-reports + uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) permissions: actions: read contents: read @@ -84,12 +91,13 @@ jobs: test-ansible, test-molecule, test-opentofu, + test-retain-native-reports, reports, ] runs-on: ubuntu-latest 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/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 8af3e37..16330b7 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 1ee7809..1184131 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 0699110..a789c7f 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml new file mode 100644 index 0000000..3e4e62e --- /dev/null +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -0,0 +1,72 @@ +--- +name: Internal - Test retain-native-reports +on: + workflow_call: +permissions: {} +jobs: + retain: + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + actions: read + contents: read + steps: + - name: Arrange - Checkout report verification helpers + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Arrange - Prepare fresh recording storage + id: recording + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + with: + operation: prepare + definition: '{"name":"Native report retention fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' + - name: Arrange - Write a native test result + id: fixture + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const fs = require('node:fs'); + const path = require('node:path'); + const directory = fs.mkdtempSync(path.join(process.env.RUNNER_TEMP, 'native-retention-fixture-')); + const file = path.join(directory, 'native.xml'); + fs.writeFileSync(file, ''); + core.setOutput('file', file); + core.setOutput('directory', directory); + - name: Act - Retain the selected native report + id: retain + uses: $/actions/retain-native-reports + with: + files: ${{ steps.fixture.outputs.file }} + report-directory: ${{ steps.recording.outputs.report-directory }} + recording: ${{ steps.recording.outputs.recording }} + outcome: success + - name: Arrange - Download retained evidence + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + with: + artifact-ids: ${{ steps.retain.outputs.artifact-id }} + path: ${{ runner.temp }}/native-retention-artifacts + - name: Assert - Verify native bytes and successful recording + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-retention-artifacts + with: + script: | + const assert = require('node:assert/strict'); + const {PublishedReports} = require('./tests/helpers/published-reports.cjs'); + const [report] = await new PublishedReports(github, context).read(1); + assert.equal(report.result.outcome, 'success'); + assert.deepEqual(report.result.errors, []); + assert.deepEqual(report.files.map(file => require('node:path').basename(file)), ['native.xml']); + assert.match(report.text, /name="retained native result"/); + - name: Cleanup - Remove fixture and downloaded files + if: always() + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + DIRECTORY: ${{ steps.fixture.outputs.directory }} + with: + script: | + const path = require('node:path'); + if (process.env.DIRECTORY) await io.rmRF(process.env.DIRECTORY); + await io.rmRF(path.join(process.env.RUNNER_TEMP, 'native-retention-artifacts')); diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 764d953..383a60a 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/.github/actions/discard-report-fixtures@c8399518df2fa64a6e163169a747765b9271e6c8 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 21e4c8b..abb6c59 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,6 +112,9 @@ in consumer workflows. `__shared-ci.yml` runs the dedicated workflows: +`__test-actions-retain-native-reports.yml` verifies the shared retention action +through its entrypoint and checks the actual retained native artifact. + | Workflow in `.github/workflows/` | Action | Coverage | | ------------------------------------------ | ----------------------- | ----------------------------------------------------------------------------------- | | `__test-actions-ansible-test.yml` | `ansible/test` | Playbook and collection sanity success/failure, native reports | @@ -304,7 +307,8 @@ job uses common `check-jobs`, requiring every producer and reporting to succeed. Native test failures can be reported successfully while the gate remains red. No report-plan output or coverage inventory is forwarded between callers. -The safety-only helper in `actions/_internal/native-reports.cjs` stages regular +The `actions/retain-native-reports` action uses the safety-only helper in +`actions/_internal/native-reports.cjs` to stage regular XML files into fresh recorder storage. It never retains environment directories, VM state, secrets or raw command logs. Each action keeps resource cleanup in its existing lifecycle, including after execution and reporting failures. diff --git a/README.md b/README.md index d677758..8574d64 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ and publish GitHub summaries, annotations, PR comments and artifacts. Verify guest deletion before removing its private runtime and SSH keys. Failed cleanup remains visible and preserves the runtime for a retry. +### Reporting + +The [native report retention action](actions/retain-native-reports/README.md) +stages validated report files for the common reporting workflow. IaC test actions +invoke it as part of their normal execution. + ## Getting started For Ansible, check out your repository on a Linux runner. Pass its pinned diff --git a/actions/ansible/test-molecule/README.md b/actions/ansible/test-molecule/README.md index 9207edf..e2ddddd 100644 --- a/actions/ansible/test-molecule/README.md +++ b/actions/ansible/test-molecule/README.md @@ -98,7 +98,7 @@ Never execute untrusted tests via pull_request_target. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 with: # Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. # This input is required. diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 851aba6..0e56f59 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 @@ -175,7 +175,7 @@ runs: - name: Retain Molecule native evidence id: reports if: ${{ !cancelled() && steps.recording.outcome == 'success' }} - uses: $/.github/actions/retain-native-reports + uses: $/actions/retain-native-reports with: outcome: ${{ steps.scenario-execution.outcome == 'success' && steps.scenario-reports.outcome == 'success' && 'success' || 'failure' }} files: ${{ steps.scenario-reports.outputs.report-files }} diff --git a/actions/ansible/test/README.md b/actions/ansible/test/README.md index 7e51ec5..62e79b1 100644 --- a/actions/ansible/test/README.md +++ b/actions/ansible/test/README.md @@ -140,7 +140,7 @@ This documentation was automatically generated by [CI Dokumentor](https://github ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@ccb0106742eda9b2724b5fa6446858af839cf861 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 with: # Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. # This input is required. diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index b369178..32f0b5a 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' @@ -185,7 +185,7 @@ runs: - name: Retain Ansible native evidence id: reports if: ${{ !cancelled() && steps.recording.outcome == 'success' }} - uses: $/.github/actions/retain-native-reports + uses: $/actions/retain-native-reports with: outcome: ${{ (steps.inputs.outputs.mode == 'playbook' && steps.playbook.outcome == 'success' || steps.inputs.outputs.mode == 'sanity' && steps.sanity.outcome == 'success') && steps.collect.outcome == 'success' && 'success' || 'failure' }} files: ${{ steps.collect.outputs.report-files }} diff --git a/actions/opentofu/test/README.md b/actions/opentofu/test/README.md index f0c7971..4be355c 100644 --- a/actions/opentofu/test/README.md +++ b/actions/opentofu/test/README.md @@ -58,7 +58,7 @@ Never execute untrusted tests via pull_request_target. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 with: # Checkout-relative module directory containing native OpenTofu tests. # This input is required. diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 0146971..1ec6b88 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 @@ -106,7 +106,7 @@ runs: - name: Retain OpenTofu native evidence id: reports if: ${{ !cancelled() && steps.recording.outcome == 'success' }} - uses: $/.github/actions/retain-native-reports + uses: $/actions/retain-native-reports with: outcome: ${{ steps.opentofu-tests.outcome == 'success' && 'success' || 'failure' }} files: ${{ steps.opentofu-tests.outputs.report }} diff --git a/actions/retain-native-reports/README.md b/actions/retain-native-reports/README.md new file mode 100644 index 0000000..9888f63 --- /dev/null +++ b/actions/retain-native-reports/README.md @@ -0,0 +1,109 @@ + + +# ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItZmlsZS10ZXh0IiBjb2xvcj0iYmx1ZSI+PHBhdGggZD0iTTE0IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY4eiI+PC9wYXRoPjxwb2x5bGluZSBwb2ludHM9IjE0IDIgMTQgOCAyMCA4Ij48L3BvbHlsaW5lPjxsaW5lIHgxPSIxNiIgeTE9IjEzIiB4Mj0iOCIgeTI9IjEzIj48L2xpbmU+PGxpbmUgeDE9IjE2IiB5MT0iMTciIHgyPSI4IiB5Mj0iMTciPjwvbGluZT48cG9seWxpbmUgcG9pbnRzPSIxMCA5IDkgOSA4IDkiPjwvcG9seWxpbmU+PC9zdmc+) GitHub Action: Retain native IaC reports + +
+ Retain native IaC reports +
+ +--- + + + + +[![Marketplace](https://img.shields.io/badge/Marketplace-retain--native--iac--reports-blue?logo=github-actions)](https://github.com/marketplace/actions/retain-native-iac-reports) +[![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-iac)](https://github.com/hoverkraft-tech/ci-github-iac/releases) +[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-iac)](http://choosealicense.com/licenses/mit/) +[![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-iac/blob/main/CONTRIBUTING.md) + + + + +## Overview + +Stage only bounded native XML files and finalize the common report contract. + +IaC producers use this action to stage native XML in fresh recording storage. +The common reporting workflow owns consolidated publication. + + + + +## Usage + +```yaml +- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 + with: + # Newline-separated native report paths selected by the producer. + # This input is required. + files: "" + + # Fresh destination allocated by common recording. + # This input is required. + report-directory: "" + + # Prepared common recording handle. + # This input is required. + recording: "" + + # Producer execution outcome. + # This input is required. + outcome: "" +``` + + + + +## Inputs + +| **Input** | **Description** | **Required** | **Default** | +| ---------------------- | --------------------------------------------------------------- | ------------ | ----------- | +| **`files`** | Newline-separated native report paths selected by the producer. | **true** | - | +| **`report-directory`** | Fresh destination allocated by common recording. | **true** | - | +| **`recording`** | Prepared common recording handle. | **true** | - | +| **`outcome`** | Producer execution outcome. | **true** | - | + + + + + + +## Outputs + +| **Output** | **Description** | +| ----------------- | -------------------------------- | +| **`artifact-id`** | Retained native result artifact. | + + + + + + +## Contributing + +Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-iac/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/). + + + + +--- + +This documentation was automatically generated by [CI Dokumentor](https://github.com/hoverkraft-tech/ci-dokumentor). + + diff --git a/.github/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml similarity index 82% rename from .github/actions/retain-native-reports/action.yml rename to actions/retain-native-reports/action.yml index 955acd5..1602431 100644 --- a/.github/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -1,5 +1,11 @@ +# IaC producers use this action to stage native XML in fresh recording storage. +# The common reporting workflow owns consolidated publication. name: Retain native IaC reports description: Stage only bounded native XML files and finalize the common report contract. +author: Hoverkraft +branding: + icon: file-text + color: blue inputs: files: description: Newline-separated native report paths selected by the producer. @@ -29,11 +35,11 @@ runs: with: script: | const path = require('node:path'); - const { stageNativeReports } = require(path.resolve(process.env.ACTION_PATH, '../../../actions/_internal/native-reports.cjs')); + const { stageNativeReports } = require(path.resolve(process.env.ACTION_PATH, '../_internal/native-reports.cjs')); stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.recording }} diff --git a/actions/vm/create/README.md b/actions/vm/create/README.md index 44b2c89..aa57bee 100644 --- a/actions/vm/create/README.md +++ b/actions/vm/create/README.md @@ -171,7 +171,7 @@ configuration private. `vm/test` uses it internally to open fresh guest logins. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/create@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/vm/create@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 with: # Creation backend, lima (default) or qemu. Testing and cleanup use the returned vm reference without another backend choice. # Default: `lima` diff --git a/actions/vm/test/README.md b/actions/vm/test/README.md index 0d20bcf..69acf16 100644 --- a/actions/vm/test/README.md +++ b/actions/vm/test/README.md @@ -70,7 +70,7 @@ Never use pull_request_target to execute untrusted suites. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@c931a508d00f4c76d8e9395dafc9ef11d26123d6 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 with: # VM reference returned by vm/create in the same job; works with either backend. # This input is required. diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 6f2a60c..345eb4a 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Run Goss assertions id: test @@ -105,7 +105,7 @@ runs: - name: Retain VM native evidence id: reports if: ${{ !cancelled() && steps.recording.outcome == 'success' }} - uses: $/.github/actions/retain-native-reports + uses: $/actions/retain-native-reports with: outcome: ${{ steps.test.outcome == 'success' && 'success' || 'failure' }} files: ${{ steps.test.outputs.report-files }} From 0e50ffdefddb9c7ed6dfea5d863ab645c9d92354 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 19:34:43 +0100 Subject: [PATCH 12/26] docs: pin generated examples to the reporting preview --- actions/ansible/test-molecule/README.md | 2 +- actions/ansible/test/README.md | 2 +- actions/opentofu/test/README.md | 2 +- actions/retain-native-reports/README.md | 2 +- actions/vm/create/README.md | 2 +- actions/vm/destroy/README.md | 2 +- actions/vm/test/README.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/actions/ansible/test-molecule/README.md b/actions/ansible/test-molecule/README.md index e2ddddd..1a8c151 100644 --- a/actions/ansible/test-molecule/README.md +++ b/actions/ansible/test-molecule/README.md @@ -98,7 +98,7 @@ Never execute untrusted tests via pull_request_target. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f with: # Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. # This input is required. diff --git a/actions/ansible/test/README.md b/actions/ansible/test/README.md index 62e79b1..045b05e 100644 --- a/actions/ansible/test/README.md +++ b/actions/ansible/test/README.md @@ -140,7 +140,7 @@ This documentation was automatically generated by [CI Dokumentor](https://github ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f with: # Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. # This input is required. diff --git a/actions/opentofu/test/README.md b/actions/opentofu/test/README.md index 4be355c..c1b6a47 100644 --- a/actions/opentofu/test/README.md +++ b/actions/opentofu/test/README.md @@ -58,7 +58,7 @@ Never execute untrusted tests via pull_request_target. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f with: # Checkout-relative module directory containing native OpenTofu tests. # This input is required. diff --git a/actions/retain-native-reports/README.md b/actions/retain-native-reports/README.md index 9888f63..a4a1a9a 100644 --- a/actions/retain-native-reports/README.md +++ b/actions/retain-native-reports/README.md @@ -33,7 +33,7 @@ The common reporting workflow owns consolidated publication. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f with: # Newline-separated native report paths selected by the producer. # This input is required. diff --git a/actions/vm/create/README.md b/actions/vm/create/README.md index aa57bee..c9b0eab 100644 --- a/actions/vm/create/README.md +++ b/actions/vm/create/README.md @@ -171,7 +171,7 @@ configuration private. `vm/test` uses it internally to open fresh guest logins. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/create@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/vm/create@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f with: # Creation backend, lima (default) or qemu. Testing and cleanup use the returned vm reference without another backend choice. # Default: `lima` diff --git a/actions/vm/destroy/README.md b/actions/vm/destroy/README.md index 6c63075..a9f6837 100644 --- a/actions/vm/destroy/README.md +++ b/actions/vm/destroy/README.md @@ -66,7 +66,7 @@ and cloud resource cleanup are outside scope. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/destroy@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/vm/destroy@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f with: # VM reference returned by vm/create in the same job; works with either creation backend. Repeated deletion is safe. # This input is required. diff --git a/actions/vm/test/README.md b/actions/vm/test/README.md index 69acf16..0174b9b 100644 --- a/actions/vm/test/README.md +++ b/actions/vm/test/README.md @@ -70,7 +70,7 @@ Never use pull_request_target to execute untrusted suites. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@ea900e96c5330ad3da233ae05601fa4800eebeb4 # 1.3.2 +- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f with: # VM reference returned by vm/create in the same job; works with either backend. # This input is required. From b9e534933cd9a3363f3be32e1373c8dc87a83878 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sun, 29 Nov 2026 20:47:37 +0100 Subject: [PATCH 13/26] ci: use bundled Node.js coverage conversion --- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 12 ++++++------ .github/workflows/__test-actions-ansible-test.yml | 4 ++-- .github/workflows/__test-actions-opentofu-test.yml | 4 ++-- .../__test-actions-retain-native-reports.yml | 4 ++-- .github/workflows/__test-actions-vm-test.yml | 6 +++--- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/retain-native-reports/action.yml | 2 +- actions/vm/test/action.yml | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index e431b03..6383381 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - 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 @@ -98,6 +98,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/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 16330b7..077809b 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 1184131..b6ac096 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index a789c7f..ab9431b 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index 3e4e62e..4fa1a9b 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Arrange - Prepare fresh recording storage id: recording - 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: '{"name":"Native report retention fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' @@ -43,7 +43,7 @@ jobs: recording: ${{ steps.recording.outputs.recording }} outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 383a60a..c0b5d4a 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0ac3dea66244dd619d6c80643958d60b886c4c02 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 0e56f59..481c3e3 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index 32f0b5a..cba634d 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 1ec6b88..f424d2e 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index 1602431..c3aa7ba 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -39,7 +39,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.recording }} diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 345eb4a..341351c 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Run Goss assertions id: test From 35152ef8183603ceaa1cd2781387a82fde81cc58 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 11:54:34 +0100 Subject: [PATCH 14/26] refactor: keep native report staging with its owning action --- .github/dependabot.yml | 1 + .github/workflows/__shared-ci.yml | 6 ++--- .../__test-actions-ansible-test-molecule.yml | 14 +++++------ .../workflows/__test-actions-ansible-test.yml | 6 ++--- .../__test-actions-opentofu-test.yml | 6 ++--- .../__test-actions-retain-native-reports.yml | 23 +++++++++++++++++-- .../workflows/__test-actions-vm-create.yml | 2 +- .../workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 8 +++---- CONTRIBUTING.md | 8 +++---- Makefile | 2 +- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/retain-native-reports/.node-version | 1 + actions/retain-native-reports/action.yml | 4 ++-- .../native-reports.cjs | 0 .../retain-native-reports/package-lock.json | 16 +++++++++++++ actions/retain-native-reports/package.json | 14 +++++++++++ .../tests/native-reports.test.cjs | 2 +- actions/vm/test/action.yml | 2 +- actions/vm/test/package.json | 2 +- 22 files changed, 88 insertions(+), 37 deletions(-) create mode 100644 actions/retain-native-reports/.node-version rename actions/{_internal => retain-native-reports}/native-reports.cjs (100%) create mode 100644 actions/retain-native-reports/package-lock.json create mode 100644 actions/retain-native-reports/package.json rename actions/{vm/test => retain-native-reports}/tests/native-reports.test.cjs (93%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 28fe933..066954c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -26,6 +26,7 @@ updates: prefix: build include: scope directories: + - "/actions/*" - "/actions/*/*" cooldown: default-days: 7 diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 6383381..5b18f55 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) permissions: actions: read contents: read @@ -98,6 +98,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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 077809b..0b7a652 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index b6ac096..40da599 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index ab9431b..be12717 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index 4fa1a9b..1d3e67e 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -4,6 +4,25 @@ on: workflow_call: permissions: {} jobs: + unit-tests: + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + steps: + - name: Arrange - Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Act - Verify staging validation + uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) + with: + working-directory: actions/retain-native-reports + command: test:ci + test-results: junit.xml + test-coverage: lcov.info + coverage: "true" retain: runs-on: ubuntu-latest timeout-minutes: 5 @@ -18,7 +37,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Arrange - Prepare fresh recording storage id: recording - 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: operation: prepare definition: '{"name":"Native report retention fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' @@ -43,7 +62,7 @@ jobs: recording: ${{ steps.recording.outputs.recording }} outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index f95a4e7..f742174 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index 6a66c60..262643a 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index c0b5d4a..cf81fe9 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@570c8389e95924c64933ea1e95f555ad7739a46f # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@a34ef0cefdef3b1e68a61cea52aae223f06f35e7 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abb6c59..dee3721 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,7 +58,7 @@ checksum aligned with `tests/fixture/lima.yml`. The Lima version is maintained in `actions/vm/create/action.yml`. Keep the token scoped to this repository and the repository configuration in `.github/renovate.json`. Dependabot owns Actions, Dockerfile, Python and action -test-package updates. Its npm directory glob `/actions/*/*` matches the action +test-package updates. Its npm directory globs `/actions/*` and `/actions/*/*` match the action package layout used by `make test`; Renovate owns Lima, Goss, the documentation image and the action `.node-version` files, grouping Node.js runtime updates in one pull request. @@ -307,14 +307,14 @@ job uses common `check-jobs`, requiring every producer and reporting to succeed. Native test failures can be reported successfully while the gate remains red. No report-plan output or coverage inventory is forwarded between callers. -The `actions/retain-native-reports` action uses the safety-only helper in -`actions/_internal/native-reports.cjs` to stage regular +The `actions/retain-native-reports` action owns `native-reports.cjs` and its +validation tests. It stages only regular XML files into fresh recorder storage. It never retains environment directories, VM state, secrets or raw command logs. Each action keeps resource cleanup in its existing lifecycle, including after execution and reporting failures. Shared VM command and workspace helpers are measured by `vm/create`; runtime ownership and cleanup are measured by `vm/destroy`. The native report staging -helper is measured by `vm/test`. Other suites still test shared behavior without +helper is measured by its owning `retain-native-reports` action. Other suites still test shared behavior without submitting overlapping primary coverage for those same files. Explicit exclusions keep maintained code in action directories named `test` measurable on Node 24. diff --git a/Makefile b/Makefile index fba35c7..da36293 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ help: ## Display help test: ## Run unit tests @set -eu; \ - for manifest in $(wildcard actions/*/*/package.json); do \ + for manifest in $(wildcard actions/*/package.json actions/*/*/package.json); do \ npm --prefix "$${manifest%/package.json}" ci --ignore-scripts --no-audit --no-fund; \ npm --prefix "$${manifest%/package.json}" test; \ done diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 481c3e3..d818c12 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index cba634d..03cd916 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index f424d2e..83406be 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/retain-native-reports/.node-version b/actions/retain-native-reports/.node-version new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/actions/retain-native-reports/.node-version @@ -0,0 +1 @@ +24 diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index c3aa7ba..998a1c4 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -35,11 +35,11 @@ runs: with: script: | const path = require('node:path'); - const { stageNativeReports } = require(path.resolve(process.env.ACTION_PATH, '../_internal/native-reports.cjs')); + const { stageNativeReports } = require(path.resolve(process.env.ACTION_PATH, 'native-reports.cjs')); stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) with: operation: finalize recording: ${{ inputs.recording }} diff --git a/actions/_internal/native-reports.cjs b/actions/retain-native-reports/native-reports.cjs similarity index 100% rename from actions/_internal/native-reports.cjs rename to actions/retain-native-reports/native-reports.cjs diff --git a/actions/retain-native-reports/package-lock.json b/actions/retain-native-reports/package-lock.json new file mode 100644 index 0000000..8d94dd0 --- /dev/null +++ b/actions/retain-native-reports/package-lock.json @@ -0,0 +1,16 @@ +{ + "name": "retain-native-reports-tests", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "retain-native-reports-tests", + "version": "0.0.0", + "license": "MIT", + "engines": { + "node": ">=24.8.0" + } + } + } +} diff --git a/actions/retain-native-reports/package.json b/actions/retain-native-reports/package.json new file mode 100644 index 0000000..988ff8d --- /dev/null +++ b/actions/retain-native-reports/package.json @@ -0,0 +1,14 @@ +{ + "name": "retain-native-reports-tests", + "version": "0.0.0", + "private": true, + "description": "Native report preservation and staging validation", + "license": "MIT", + "engines": { + "node": ">=24.8.0" + }, + "scripts": { + "test": "node --test", + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + } +} diff --git a/actions/vm/test/tests/native-reports.test.cjs b/actions/retain-native-reports/tests/native-reports.test.cjs similarity index 93% rename from actions/vm/test/tests/native-reports.test.cjs rename to actions/retain-native-reports/tests/native-reports.test.cjs index c14c303..181d639 100644 --- a/actions/vm/test/tests/native-reports.test.cjs +++ b/actions/retain-native-reports/tests/native-reports.test.cjs @@ -3,7 +3,7 @@ const fs = require("node:fs"); const os = require("node:os"); const path = require("node:path"); const { suite, test } = require("node:test"); -const { stageNativeReports } = require("../../../_internal/native-reports.cjs"); +const { stageNativeReports } = require("../native-reports.cjs"); suite("native report staging", () => { test("preserves bytes and rejects private files, symlinks and reused destinations", (t) => { diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 341351c..19adc44 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) - name: Run Goss assertions id: test diff --git a/actions/vm/test/package.json b/actions/vm/test/package.json index b993e18..f158cf4 100644 --- a/actions/vm/test/package.json +++ b/actions/vm/test/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-coverage-include='../../_internal/native-reports.cjs' --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" }, "devDependencies": { "@actions/exec": "3.0.0", From ba1a154651f97db66d8f2f80d7c5c6750f168db3 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 13:43:14 +0100 Subject: [PATCH 15/26] refactor(ci): adopt standalone report publication actions --- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 14 +++++++------- .github/workflows/__test-actions-ansible-test.yml | 6 +++--- .github/workflows/__test-actions-opentofu-test.yml | 6 +++--- .../__test-actions-retain-native-reports.yml | 6 +++--- .github/workflows/__test-actions-vm-create.yml | 2 +- .github/workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 8 ++++---- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/retain-native-reports/action.yml | 2 +- actions/vm/test/action.yml | 2 +- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 5b18f55..0b50718 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/ci-reports.yml@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) permissions: actions: read contents: read @@ -98,6 +98,6 @@ jobs: timeout-minutes: 5 permissions: {} steps: - - uses: hoverkraft-tech/ci-github-common/actions/check-jobs@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # 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-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 0b7a652..e4365eb 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 40da599..9be4187 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index be12717..2bab3b0 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index 1d3e67e..161a11f 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: working-directory: actions/retain-native-reports command: test:ci @@ -37,7 +37,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Arrange - Prepare fresh recording storage id: recording - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: operation: prepare definition: '{"name":"Native report retention fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' @@ -62,7 +62,7 @@ jobs: recording: ${{ steps.recording.outputs.recording }} outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index f742174..0a5d931 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # 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-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index 262643a..fdc0003 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # 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-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index cf81fe9..d38de1b 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@5464ea3d3a1101ce19cb28287bbec9af3bca7ebb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@e83767d00d66b692aafa5a5d697fbf8aaba3b444 # PR #624 (unreleased) with: test-results: junit.xml test-coverage: lcov.info @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index d818c12..722880d 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index 03cd916..275026c 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 83406be..9245f40 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index 998a1c4..691b59a 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -39,7 +39,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) with: operation: finalize recording: ${{ inputs.recording }} diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index 19adc44..b280513 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@dc29a8bc52f1e7e5b17c9d891a90cde2bfcd7f45 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) - name: Run Goss assertions id: test From 5ede6dd791fa46005bf4bd67a801daa91904736a Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 14:01:21 +0100 Subject: [PATCH 16/26] refactor(ci): adopt standalone report publication actions --- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 14 +++++++------- .github/workflows/__test-actions-ansible-test.yml | 6 +++--- .github/workflows/__test-actions-opentofu-test.yml | 6 +++--- .../__test-actions-retain-native-reports.yml | 6 +++--- .github/workflows/__test-actions-vm-create.yml | 2 +- .github/workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 8 ++++---- actions/ansible/test-molecule/action.yml | 2 +- actions/ansible/test/action.yml | 2 +- actions/opentofu/test/action.yml | 2 +- actions/retain-native-reports/action.yml | 2 +- actions/vm/test/action.yml | 2 +- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 0b50718..84150e8 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - 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 @@ -98,6 +98,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-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index e4365eb..d2652a2 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - 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 @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 9be4187..3933fd5 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - 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 @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 2bab3b0..c250b97 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - 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 @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index 161a11f..b93f6ee 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - 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: working-directory: actions/retain-native-reports command: test:ci @@ -37,7 +37,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Arrange - Prepare fresh recording storage id: recording - 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: '{"name":"Native report retention fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' @@ -62,7 +62,7 @@ jobs: recording: ${{ steps.recording.outputs.recording }} outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 0a5d931..58a5e7e 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - 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-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index fdc0003..b1025bd 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - 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-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index d38de1b..02e3130 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - 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 @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@0dbf8c312048a8d354e1b0bab3e90627114c6faa # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index 722880d..ae76c52 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -119,7 +119,7 @@ runs: with: definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index 275026c..6405b7e 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -115,7 +115,7 @@ runs: with: definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' diff --git a/actions/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 9245f40..5d570b0 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -81,7 +81,7 @@ runs: with: definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} operation: 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) - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index 691b59a..2a61968 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -39,7 +39,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.recording }} diff --git a/actions/vm/test/action.yml b/actions/vm/test/action.yml index b280513..4f1e521 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -69,7 +69,7 @@ runs: with: definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' operation: 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) - name: Run Goss assertions id: test From a097f61bb3453c96cef27df54bb737797ec3ddb7 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 17:15:19 +0100 Subject: [PATCH 17/26] refactor(reports)!: compose common report preparation --- .github/workflows/__shared-ci.yml | 6 +- .../__test-actions-ansible-test-molecule.yml | 14 ++--- .../workflows/__test-actions-ansible-test.yml | 6 +- .../__test-actions-opentofu-test.yml | 6 +- .../__test-actions-retain-native-reports.yml | 18 ++---- .../workflows/__test-actions-vm-create.yml | 2 +- .../workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 8 +-- actions/ansible/test-molecule/README.md | 44 ++++---------- actions/ansible/test-molecule/action.yml | 41 +++++++------ actions/ansible/test/README.md | 28 +-------- actions/ansible/test/action.yml | 57 ++++++++++++------- actions/opentofu/test/README.md | 28 +-------- actions/opentofu/test/action.yml | 27 +++++---- actions/retain-native-reports/README.md | 51 ++++------------- actions/retain-native-reports/action.yml | 34 ++++++----- actions/vm/test/README.md | 28 +-------- actions/vm/test/action.yml | 24 ++++---- tests/helpers/published-reports.cjs | 40 +++++-------- 19 files changed, 170 insertions(+), 294 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 84150e8..e70bb3b 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - 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 @@ -98,6 +98,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-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index d2652a2..c48b794 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - 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 @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -83,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} vm: @@ -134,7 +134,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -166,7 +166,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-2 @@ -198,7 +198,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 @@ -220,7 +220,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 3933fd5..fa94301 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - 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 @@ -73,7 +73,7 @@ jobs: target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -98,6 +98,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index c250b97..46d8324 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - 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 @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -90,6 +90,6 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index b93f6ee..4b55ef6 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - 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: working-directory: actions/retain-native-reports command: test:ci @@ -35,12 +35,6 @@ jobs: with: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - - name: Arrange - Prepare fresh recording storage - id: recording - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) - with: - operation: prepare - definition: '{"name":"Native report retention fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' - name: Arrange - Write a native test result id: fixture uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -58,15 +52,15 @@ jobs: uses: $/actions/retain-native-reports with: files: ${{ steps.fixture.outputs.file }} - report-directory: ${{ steps.recording.outputs.report-directory }} - recording: ${{ steps.recording.outputs.recording }} + definition: '{"name":"Native report retention + fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts - - name: Assert - Verify native bytes and successful recording + - name: Assert - Verify native bytes and successful preparation uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-retention-artifacts @@ -77,7 +71,7 @@ jobs: const [report] = await new PublishedReports(github, context).read(1); assert.equal(report.result.outcome, 'success'); assert.deepEqual(report.result.errors, []); - assert.deepEqual(report.files.map(file => require('node:path').basename(file)), ['native.xml']); + assert.deepEqual(report.files.map(file => require('node:path').basename(file)), ['1-native.xml']); assert.match(report.text, /name="retained native result"/); - name: Cleanup - Remove fixture and downloaded files if: always() diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 58a5e7e..b80bebb 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - 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-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index b1025bd..bb6813a 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - 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-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 02e3130..1474e31 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - 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 @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -156,7 +156,7 @@ jobs: core.setOutput('negative-fixtures', await published.negativeFixtures()); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/ansible/test-molecule/README.md b/actions/ansible/test-molecule/README.md index 1a8c151..5c80c4a 100644 --- a/actions/ansible/test-molecule/README.md +++ b/actions/ansible/test-molecule/README.md @@ -2,20 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: Ansible - Test Molecule -
- Ansible - Test Molecule -
- ---- - [![Marketplace](https://img.shields.io/badge/Marketplace-ansible------test--molecule-blue?logo=github-actions)](https://github.com/marketplace/actions/ansible---test-molecule) [![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-iac)](https://github.com/hoverkraft-tech/ci-github-iac/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-iac)](http://choosealicense.com/licenses/mit/) [![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-iac/blob/main/CONTRIBUTING.md) @@ -88,7 +80,7 @@ a scenario targeting an externally created VM must not destroy it itself. Only native test outcomes are retained; no execution-status test is invented. Runtime state, inventory, installed tools and raw logs stay private. Native assertion details are public: use synthetic data and no_log for private values. -Call common ci-reports once after all producers, then a separate CI complete +Call common publish-ci-reports once after all producers, then a separate CI complete gate. Producers need contents: read and actions: read, without comment permissions. Never execute untrusted tests via pull_request_target. @@ -98,7 +90,7 @@ Never execute untrusted tests via pull_request_target. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test-molecule@5ede6dd791fa46005bf4bd67a801daa91904736a # refactor/unified-ci-reporting with: # Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. # This input is required. @@ -108,7 +100,7 @@ Never execute untrusted tests via pull_request_target. # This input is required. ansible-requirements: "" - # Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. + # Controller Python version file for the pinned Molecule runtime. Empty uses the root .python-version, then the runner Python. python-version-file: "" # Optional checkout-relative ansible.cfg for scenario execution and collection search paths. @@ -124,13 +116,13 @@ Never execute untrusted tests via pull_request_target. ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ----------- | -| **`molecule-scenario`** | Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. | **true** | - | -| **`ansible-requirements`** | Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. | **true** | - | -| **`python-version-file`** | Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. | **false** | - | -| **`ansible-config`** | Optional checkout-relative ansible.cfg for scenario execution and collection search paths. | **false** | - | -| **`test-timeout-minutes`** | Native test sequence deadline, from 1 to 40 minutes. Interrupted runs allow two additional minutes for scenario cleanup. | **false** | `20` | +| **Input** | **Description** | **Required** | **Default** | +| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------- | +| **`molecule-scenario`** | Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. | **true** | - | +| **`ansible-requirements`** | Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. | **true** | - | +| **`python-version-file`** | Controller Python version file for the pinned Molecule runtime. Empty uses the root .python-version, then the runner Python. | **false** | - | +| **`ansible-config`** | Optional checkout-relative ansible.cfg for scenario execution and collection search paths. | **false** | - | +| **`test-timeout-minutes`** | Native test sequence deadline, from 1 to 40 minutes. Interrupted runs allow two additional minutes for scenario cleanup. | **false** | `20` | @@ -147,26 +139,10 @@ Never execute untrusted tests via pull_request_target. - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-iac/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/ansible/test-molecule/action.yml b/actions/ansible/test-molecule/action.yml index ae76c52..6d93e53 100644 --- a/actions/ansible/test-molecule/action.yml +++ b/actions/ansible/test-molecule/action.yml @@ -62,31 +62,41 @@ # Only native test outcomes are retained; no execution-status test is invented. # Runtime state, inventory, installed tools and raw logs stay private. Native # assertion details are public: use synthetic data and no_log for private values. -# Call common ci-reports once after all producers, then a separate CI complete +# Call common publish-ci-reports once after all producers, then a separate CI complete # gate. Producers need contents: read and actions: read, without comment permissions. # Never execute untrusted tests via pull_request_target. --- name: Ansible - Test Molecule -description: Run molecule tests and retain validated native evidence for consolidated CI reporting. +description: Run molecule tests and retain validated native evidence for + consolidated CI reporting. author: Hoverkraft branding: icon: check-circle color: purple inputs: molecule-scenario: - description: Checkout-relative directory containing molecule.yml. The scenario defines its inventory, playbooks and test sequence. + description: + Checkout-relative directory containing molecule.yml. The scenario + defines its inventory, playbooks and test sequence. required: true ansible-requirements: - description: Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. + description: + Checkout-relative requirements file containing exactly one stable + ansible-core==X.Y.Z pin. required: true python-version-file: - description: Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. + description: Controller Python version file for the pinned Molecule runtime. + Empty uses the root .python-version, then the runner Python. default: "" ansible-config: - description: Optional checkout-relative ansible.cfg for scenario execution and collection search paths. + description: + Optional checkout-relative ansible.cfg for scenario execution and + collection search paths. default: "" test-timeout-minutes: - description: Native test sequence deadline, from 1 to 40 minutes. Interrupted runs allow two additional minutes for scenario cleanup. + description: + Native test sequence deadline, from 1 to 40 minutes. Interrupted + runs allow two additional minutes for scenario cleanup. default: "20" outputs: report-artifact-id: @@ -114,13 +124,6 @@ runs: core.setFailed(error.message); } - - name: Register expected native test reports - id: recording - with: - definition: '{"name":"Molecule tests","reports":[{"kind":"test","pattern":"*.xml"}]}' - operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) - - name: Set up the controller Python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: @@ -174,10 +177,12 @@ runs: - name: Retain Molecule native evidence id: reports - if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + if: ${{ !cancelled() && steps.scenario-inputs.outcome == 'success' }} uses: $/actions/retain-native-reports with: - outcome: ${{ steps.scenario-execution.outcome == 'success' && steps.scenario-reports.outcome == 'success' && 'success' || 'failure' }} + outcome: ${{ steps.scenario-execution.outcome == 'success' && + steps.scenario-reports.outcome == 'success' && 'success' || 'failure' + }} files: ${{ steps.scenario-reports.outputs.report-files }} - report-directory: ${{ steps.recording.outputs.report-directory }} - recording: ${{ steps.recording.outputs.recording }} + definition: '{"name":"Molecule + tests","reports":[{"kind":"test","pattern":"*.xml"}]}' diff --git a/actions/ansible/test/README.md b/actions/ansible/test/README.md index 045b05e..c960a86 100644 --- a/actions/ansible/test/README.md +++ b/actions/ansible/test/README.md @@ -2,20 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: Ansible - Test -
- Ansible - Test -
- ---- - [![Marketplace](https://img.shields.io/badge/Marketplace-ansible------test-blue?logo=github-actions)](https://github.com/marketplace/actions/ansible---test) [![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-iac)](https://github.com/hoverkraft-tech/ci-github-iac/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-iac)](http://choosealicense.com/licenses/mit/) [![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-iac/blob/main/CONTRIBUTING.md) @@ -69,7 +61,7 @@ collection job so native `tests/output/junit` contains only that run's reports. ### Publish results -Native JUnit is validated and retained through common record-ci-reports. +Native JUnit is validated and retained through common prepare-ci-reports. Use synthetic expectations: native reports may contain assertion details. Call ci-reports once after every producer and add a separate CI complete gate. Producers need contents: read and actions: read, without comment permissions. @@ -107,26 +99,10 @@ the consolidated report or comment. Never use pull_request_target for tests. - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-iac/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/). - @@ -140,7 +116,7 @@ This documentation was automatically generated by [CI Dokumentor](https://github ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f +- uses: hoverkraft-tech/ci-github-iac/actions/ansible/test@5ede6dd791fa46005bf4bd67a801daa91904736a # refactor/unified-ci-reporting with: # Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. # This input is required. diff --git a/actions/ansible/test/action.yml b/actions/ansible/test/action.yml index 6405b7e..3cfcf7a 100644 --- a/actions/ansible/test/action.yml +++ b/actions/ansible/test/action.yml @@ -43,7 +43,7 @@ # # ### Publish results # -# Native JUnit is validated and retained through common record-ci-reports. +# Native JUnit is validated and retained through common prepare-ci-reports. # Use synthetic expectations: native reports may contain assertion details. # Call ci-reports once after every producer and add a separate CI complete gate. # Producers need contents: read and actions: read, without comment permissions. @@ -51,35 +51,49 @@ # the consolidated report or comment. Never use pull_request_target for tests. --- name: Ansible - Test -description: Run Ansible tests and retain validated native evidence for consolidated CI reporting. +description: Run Ansible tests and retain validated native evidence for + consolidated CI reporting. author: Hoverkraft branding: icon: check-circle color: purple inputs: ansible-requirements: - description: Checkout-relative requirements file containing exactly one stable ansible-core==X.Y.Z pin. + description: + Checkout-relative requirements file containing exactly one stable + ansible-core==X.Y.Z pin. required: true test-playbook: - description: Checkout-relative playbook containing test assertions. This playbook is executed. Supply test-playbook or collection, exclusively. + description: Checkout-relative playbook containing test assertions. This + playbook is executed. Supply test-playbook or collection, exclusively. default: "" collection: - description: One checked-out collection directory containing galaxy.yml. Use a matrix for multiple collections. + description: + One checked-out collection directory containing galaxy.yml. Use a + matrix for multiple collections. default: "" target-python-version: - description: Optional Python major.minor for collection sanity checks. Empty tests all versions supported by Ansible Core. + description: Optional Python major.minor for collection sanity checks. Empty + tests all versions supported by Ansible Core. default: "" sanity-image: - description: Optional pinned Docker image for collection sanity. Requires target-python-version; empty uses Ansible Core's default image and Python matrix. + description: Optional pinned Docker image for collection sanity. Requires + target-python-version; empty uses Ansible Core's default image and Python + matrix. default: "" python-version-file: - description: Optional checkout-relative controller Python version file. Otherwise setup-python reads the root .python-version or uses the runner Python. For playbook or Molecule execution only; choose a version supported by the pinned tools. + description: Optional checkout-relative controller Python version file. + Otherwise setup-python reads the root .python-version or uses the runner + Python. For playbook or Molecule execution only; choose a version + supported by the pinned tools. default: "" ansible-config: description: Optional checkout-relative ansible.cfg file for test playbook execution. default: "" galaxy-requirements: - description: Optional checkout-relative Galaxy requirements file for third-party role and collection dependencies. + description: + Optional checkout-relative Galaxy requirements file for third-party + role and collection dependencies. default: "" outputs: report-artifact-id: @@ -110,13 +124,6 @@ runs: core.setFailed(error.message); } - - name: Register expected native test reports - id: recording - with: - definition: '{"name":"Ansible tests","reports":[{"kind":"test","pattern":"*.xml"}]}' - operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) - - name: Set up the controller Python if: steps.inputs.outputs.mode == 'playbook' uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 @@ -162,7 +169,8 @@ runs: collection-root: ${{ steps.inputs.outputs.collection-root }} target-python-version: ${{ steps.inputs.outputs.target-python-version }} docker-image: ${{ steps.inputs.outputs.sanity-image }} - test-deps: ${{ steps.inputs.outputs.galaxy != '' && format('-r {0}', steps.inputs.outputs.galaxy) || '' }} + test-deps: ${{ steps.inputs.outputs.galaxy != '' && format('-r {0}', + steps.inputs.outputs.galaxy) || '' }} coverage: never - name: Collect native Ansible reports @@ -172,7 +180,8 @@ runs: env: ACTION_PATH: ${{ github.action_path }} ANSIBLE_REPORT_DIRECTORY: ${{ steps.inputs.outputs.report-directory }} - ANSIBLE_COLLECTION_ROOT: ${{ steps.sanity.outputs.checkout-directory || steps.inputs.outputs.collection }} + ANSIBLE_COLLECTION_ROOT: ${{ steps.sanity.outputs.checkout-directory || + steps.inputs.outputs.collection }} with: script: | try { @@ -184,10 +193,14 @@ runs: - name: Retain Ansible native evidence id: reports - if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + if: ${{ !cancelled() && steps.inputs.outcome == 'success' }} uses: $/actions/retain-native-reports with: - outcome: ${{ (steps.inputs.outputs.mode == 'playbook' && steps.playbook.outcome == 'success' || steps.inputs.outputs.mode == 'sanity' && steps.sanity.outcome == 'success') && steps.collect.outcome == 'success' && 'success' || 'failure' }} + outcome: + ${{ (steps.inputs.outputs.mode == 'playbook' && steps.playbook.outcome + == 'success' || steps.inputs.outputs.mode == 'sanity' && + steps.sanity.outcome == 'success') && steps.collect.outcome == + 'success' && 'success' || 'failure' }} files: ${{ steps.collect.outputs.report-files }} - report-directory: ${{ steps.recording.outputs.report-directory }} - recording: ${{ steps.recording.outputs.recording }} + definition: '{"name":"Ansible + tests","reports":[{"kind":"test","pattern":"*.xml"}]}' diff --git a/actions/opentofu/test/README.md b/actions/opentofu/test/README.md index c1b6a47..51decc3 100644 --- a/actions/opentofu/test/README.md +++ b/actions/opentofu/test/README.md @@ -2,20 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: OpenTofu - Test -
- OpenTofu - Test -
- ---- - [![Marketplace](https://img.shields.io/badge/Marketplace-opentofu------test-blue?logo=github-actions)](https://github.com/marketplace/actions/opentofu---test) [![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-iac)](https://github.com/hoverkraft-tech/ci-github-iac/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-iac)](http://choosealicense.com/licenses/mit/) [![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-iac/blob/main/CONTRIBUTING.md) @@ -48,7 +40,7 @@ test names and filenames are public report metadata. Only native test outcomes are retained; no execution-status test is invented. Runtime state, inventory, installed tools and raw logs stay private. Native assertion details are public: use synthetic data and no_log for private values. -Call common ci-reports once after all producers, then a separate CI complete +Call common publish-ci-reports once after all producers, then a separate CI complete gate. Producers need contents: read and actions: read, without comment permissions. Never execute untrusted tests via pull_request_target. @@ -58,7 +50,7 @@ Never execute untrusted tests via pull_request_target. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f +- uses: hoverkraft-tech/ci-github-iac/actions/opentofu/test@5ede6dd791fa46005bf4bd67a801daa91904736a # refactor/unified-ci-reporting with: # Checkout-relative module directory containing native OpenTofu tests. # This input is required. @@ -94,26 +86,10 @@ Never execute untrusted tests via pull_request_target. - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-iac/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/opentofu/test/action.yml b/actions/opentofu/test/action.yml index 5d570b0..564e263 100644 --- a/actions/opentofu/test/action.yml +++ b/actions/opentofu/test/action.yml @@ -22,12 +22,13 @@ # Only native test outcomes are retained; no execution-status test is invented. # Runtime state, inventory, installed tools and raw logs stay private. Native # assertion details are public: use synthetic data and no_log for private values. -# Call common ci-reports once after all producers, then a separate CI complete +# Call common publish-ci-reports once after all producers, then a separate CI complete # gate. Producers need contents: read and actions: read, without comment permissions. # Never execute untrusted tests via pull_request_target. --- name: OpenTofu - Test -description: Run opentofu tests and retain validated native evidence for consolidated CI reporting. +description: Run opentofu tests and retain validated native evidence for + consolidated CI reporting. author: Hoverkraft branding: icon: check-circle @@ -37,7 +38,9 @@ inputs: description: Checkout-relative module directory containing native OpenTofu tests. required: true tofu-version-file: - description: Checkout-relative file containing an exact stable OpenTofu version maintained by the consumer. + description: + Checkout-relative file containing an exact stable OpenTofu version + maintained by the consumer. required: true outputs: report-artifact-id: @@ -76,13 +79,6 @@ runs: core.setOutput('directory', reports); core.setOutput('id', path.basename(reports)); - - name: Register expected native test reports - id: recording - with: - definition: ${{ format('{{"name":"OpenTofu tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', toJSON(steps.inputs.outputs.project)) }} - operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) - - name: Install the pinned OpenTofu runtime uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 with: @@ -105,10 +101,13 @@ runs: - name: Retain OpenTofu native evidence id: reports - if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + if: ${{ !cancelled() && steps.inputs.outcome == 'success' }} uses: $/actions/retain-native-reports with: - outcome: ${{ steps.opentofu-tests.outcome == 'success' && 'success' || 'failure' }} + outcome: + ${{ steps.opentofu-tests.outcome == 'success' && 'success' || 'failure' + }} files: ${{ steps.opentofu-tests.outputs.report }} - report-directory: ${{ steps.recording.outputs.report-directory }} - recording: ${{ steps.recording.outputs.recording }} + definition: ${{ format('{{"name":"OpenTofu + tests","project":{0},"reports":[{{"kind":"test","pattern":"*.xml"}}]}}', + toJSON(steps.inputs.outputs.project)) }} diff --git a/actions/retain-native-reports/README.md b/actions/retain-native-reports/README.md index a4a1a9a..02d4dc9 100644 --- a/actions/retain-native-reports/README.md +++ b/actions/retain-native-reports/README.md @@ -2,20 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItZmlsZS10ZXh0IiBjb2xvcj0iYmx1ZSI+PHBhdGggZD0iTTE0IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY4eiI+PC9wYXRoPjxwb2x5bGluZSBwb2ludHM9IjE0IDIgMTQgOCAyMCA4Ij48L3BvbHlsaW5lPjxsaW5lIHgxPSIxNiIgeTE9IjEzIiB4Mj0iOCIgeTI9IjEzIj48L2xpbmU+PGxpbmUgeDE9IjE2IiB5MT0iMTciIHgyPSI4IiB5Mj0iMTciPjwvbGluZT48cG9seWxpbmUgcG9pbnRzPSIxMCA5IDkgOSA4IDkiPjwvcG9seWxpbmU+PC9zdmc+) GitHub Action: Retain native IaC reports -
- Retain native IaC reports -
- ---- - [![Marketplace](https://img.shields.io/badge/Marketplace-retain--native--iac--reports-blue?logo=github-actions)](https://github.com/marketplace/actions/retain-native-iac-reports) [![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-iac)](https://github.com/hoverkraft-tech/ci-github-iac/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-iac)](http://choosealicense.com/licenses/mit/) [![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-iac/blob/main/CONTRIBUTING.md) @@ -24,7 +16,7 @@ Stage only bounded native XML files and finalize the common report contract. -IaC producers use this action to stage native XML in fresh recording storage. +IaC producers use this action to stage native XML in fresh report storage. The common reporting workflow owns consolidated publication. @@ -33,23 +25,19 @@ The common reporting workflow owns consolidated publication. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f +- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@5ede6dd791fa46005bf4bd67a801daa91904736a # refactor/unified-ci-reporting with: # Newline-separated native report paths selected by the producer. # This input is required. files: "" - # Fresh destination allocated by common recording. - # This input is required. - report-directory: "" - - # Prepared common recording handle. - # This input is required. - recording: "" - # Producer execution outcome. # This input is required. outcome: "" + + # JSON report definition provided by the producer. + # This input is required. + definition: "" ``` @@ -57,12 +45,11 @@ The common reporting workflow owns consolidated publication. ## Inputs -| **Input** | **Description** | **Required** | **Default** | -| ---------------------- | --------------------------------------------------------------- | ------------ | ----------- | -| **`files`** | Newline-separated native report paths selected by the producer. | **true** | - | -| **`report-directory`** | Fresh destination allocated by common recording. | **true** | - | -| **`recording`** | Prepared common recording handle. | **true** | - | -| **`outcome`** | Producer execution outcome. | **true** | - | +| **Input** | **Description** | **Required** | **Default** | +| ---------------- | --------------------------------------------------------------- | ------------ | ----------- | +| **`files`** | Newline-separated native report paths selected by the producer. | **true** | - | +| **`outcome`** | Producer execution outcome. | **true** | - | +| **`definition`** | JSON report definition provided by the producer. | **true** | - | @@ -79,26 +66,10 @@ The common reporting workflow owns consolidated publication. - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-iac/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/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index 2a61968..478f0ab 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -1,4 +1,4 @@ -# IaC producers use this action to stage native XML in fresh recording storage. +# IaC producers use this action to stage native XML in fresh report storage. # The common reporting workflow owns consolidated publication. name: Retain native IaC reports description: Stage only bounded native XML files and finalize the common report contract. @@ -10,15 +10,12 @@ inputs: files: description: Newline-separated native report paths selected by the producer. required: true - report-directory: - description: Fresh destination allocated by common recording. - required: true - recording: - description: Prepared common recording handle. - required: true outcome: description: Producer execution outcome. required: true + definition: + description: JSON report definition provided by the producer. + required: true outputs: artifact-id: description: Retained native result artifact. @@ -31,16 +28,27 @@ runs: env: ACTION_PATH: ${{ github.action_path }} NATIVE_REPORTS: ${{ inputs.files }} - REPORT_DIRECTORY: ${{ inputs.report-directory }} with: script: | + const fs = require('node:fs'); const path = require('node:path'); const { stageNativeReports } = require(path.resolve(process.env.ACTION_PATH, 'native-reports.cjs')); - stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), process.env.REPORT_DIRECTORY); + const directory = fs.mkdtempSync(path.join(process.env.RUNNER_TEMP, 'iac-reports-')); + core.setOutput('directory', directory); + stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), directory); - id: reports if: ${{ !cancelled() }} - 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: + definition: ${{ inputs.definition }} + directory: ${{ steps.stage.outputs.directory }} + outcome: + ${{ inputs.outcome == 'success' && steps.stage.outcome == 'success' && + 'success' || 'failure' }} + - name: Clean retained report staging + if: ${{ always() && steps.stage.outputs.directory != '' }} + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + REPORT_DIRECTORY: ${{ steps.stage.outputs.directory }} with: - operation: finalize - recording: ${{ inputs.recording }} - outcome: ${{ inputs.outcome == 'success' && steps.stage.outcome == 'success' && 'success' || 'failure' }} + script: await io.rmRF(process.env.REPORT_DIRECTORY); diff --git a/actions/vm/test/README.md b/actions/vm/test/README.md index 0174b9b..a6ca5c2 100644 --- a/actions/vm/test/README.md +++ b/actions/vm/test/README.md @@ -2,20 +2,12 @@ # ![Icon](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2stY2lyY2xlIiBjb2xvcj0icHVycGxlIj48cGF0aCBkPSJNMjIgMTEuMDhWMTJhMTAgMTAgMCAxIDEtNS45My05LjE0Ij48L3BhdGg+PHBvbHlsaW5lIHBvaW50cz0iMjIgNCAxMiAxNC4wMSA5IDExLjAxIj48L3BvbHlsaW5lPjwvc3ZnPg==) GitHub Action: VM - Test -
- VM - Test -
- ---- - [![Marketplace](https://img.shields.io/badge/Marketplace-vm------test-blue?logo=github-actions)](https://github.com/marketplace/actions/vm---test) [![Release](https://img.shields.io/github/v/release/hoverkraft-tech/ci-github-iac)](https://github.com/hoverkraft-tech/ci-github-iac/releases) -[![License](https://img.shields.io/github/license/hoverkraft-tech/ci-github-iac)](http://choosealicense.com/licenses/mit/) [![Stars](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social)](https://img.shields.io/github/stars/hoverkraft-tech/ci-github-iac?style=social) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/hoverkraft-tech/ci-github-iac/blob/main/CONTRIBUTING.md) @@ -59,7 +51,7 @@ then validates and retains it even after assertion failures. No synthetic test case is added for execution status. VM cleanup stays with the caller. Native assertion details are public: never match or print credentials. Infrastructure assertions produce test results, not application code coverage. -Call common ci-reports once after all test jobs. Producers need contents: read +Call common publish-ci-reports once after all test jobs. Producers need contents: read and actions: read; comments and summaries belong to the reporting workflow. Use a separate CI complete gate for all required jobs and reporting. Never use pull_request_target to execute untrusted suites. @@ -70,7 +62,7 @@ Never use pull_request_target to execute untrusted suites. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@c4a1af55d8d3ac9e10e424c3b81c5aac63a8144f +- uses: hoverkraft-tech/ci-github-iac/actions/vm/test@5ede6dd791fa46005bf4bd67a801daa91904736a # refactor/unified-ci-reporting with: # VM reference returned by vm/create in the same job; works with either backend. # This input is required. @@ -115,26 +107,10 @@ Never use pull_request_target to execute untrusted suites. - -## Contributing - -Contributions are welcome! Please see the [contributing guidelines](https://github.com/hoverkraft-tech/ci-github-iac/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/vm/test/action.yml b/actions/vm/test/action.yml index 4f1e521..f6700f4 100644 --- a/actions/vm/test/action.yml +++ b/actions/vm/test/action.yml @@ -33,26 +33,30 @@ # case is added for execution status. VM cleanup stays with the caller. # Native assertion details are public: never match or print credentials. # Infrastructure assertions produce test results, not application code coverage. -# Call common ci-reports once after all test jobs. Producers need contents: read +# Call common publish-ci-reports once after all test jobs. Producers need contents: read # and actions: read; comments and summaries belong to the reporting workflow. # Use a separate CI complete gate for all required jobs and reporting. # Never use pull_request_target to execute untrusted suites. --- name: VM - Test -description: Run vm tests and retain validated native evidence for consolidated CI reporting. +description: Run vm tests and retain validated native evidence for consolidated + CI reporting. author: Hoverkraft branding: icon: check-circle color: purple inputs: vm: - description: VM reference returned by vm/create in the same job; works with either backend. + description: VM reference returned by vm/create in the same job; works with + either backend. required: true goss-file: description: Required checkout-relative Goss suite, including any referenced Goss files. required: true goss-vars: - description: Optional checkout-relative JSON or YAML variables file. Use values suitable for public reports. + description: + Optional checkout-relative JSON or YAML variables file. Use values + suitable for public reports. default: "" test-timeout-minutes: description: Combined Goss setup and execution timeout, from 1 to 40 minutes. @@ -64,13 +68,6 @@ outputs: runs: using: composite steps: - - name: Register expected native test reports - id: recording - with: - definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' - operation: prepare - uses: hoverkraft-tech/ci-github-common/actions/quality/record-ci-reports@2d27a658505a68fba050c44cb6a6d4d08a45e8f2 # PR #683 (unreleased) - - name: Run Goss assertions id: test uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -104,10 +101,9 @@ runs: - name: Retain VM native evidence id: reports - if: ${{ !cancelled() && steps.recording.outcome == 'success' }} + if: ${{ !cancelled() }} uses: $/actions/retain-native-reports with: outcome: ${{ steps.test.outcome == 'success' && 'success' || 'failure' }} files: ${{ steps.test.outputs.report-files }} - report-directory: ${{ steps.recording.outputs.report-directory }} - recording: ${{ steps.recording.outputs.recording }} + definition: '{"name":"VM tests","reports":[{"kind":"test","pattern":"*.xml"}]}' diff --git a/tests/helpers/published-reports.cjs b/tests/helpers/published-reports.cjs index 7028145..2ea763d 100644 --- a/tests/helpers/published-reports.cjs +++ b/tests/helpers/published-reports.cjs @@ -1,9 +1,8 @@ const assert = require("node:assert/strict"); const fs = require("node:fs"); const path = require("node:path"); -const { createHash } = require("node:crypto"); -// Inspect the actual retained bytes through the shared download action. +// Inspect the bytes downloaded by the public artifact action. class PublishedReports { constructor(github, context) { Object.assign(this, { github, context }); @@ -12,7 +11,7 @@ class PublishedReports { const directory = process.env.EVIDENCE_DIRECTORY; const manifests = fs .readdirSync(directory, { recursive: true }) - .filter((file) => path.basename(file) === "result.json"); + .filter((file) => path.basename(file) === "report.json"); assert.equal(manifests.length, expectedCount); const artifacts = await this.github.paginate( this.github.rest.actions.listWorkflowRunArtifacts, @@ -21,24 +20,20 @@ class PublishedReports { return manifests.map((file) => { const root = path.dirname(path.join(directory, file)); const result = JSON.parse( - fs.readFileSync(path.join(root, "result.json"), "utf8"), + fs.readFileSync(path.join(root, "report.json"), "utf8"), ); - assert.equal(result.version, 2); - assert.match(result.id, /^[a-f0-9-]{36}$/); + assert.equal(result.version, 1); + assert.equal(result.run, String(this.context.runId)); const artifact = artifacts.find( - (item) => item.name === `ci-report-v2-result-${result.id}`, + (item) => item.name === result.artifactName, ); assert.ok(artifact); assert.equal(artifact.expired, false); - const files = result.assets.map((asset) => path.join(root, asset.file)); - for (const asset of result.assets) { - assert.match(asset.file, /^reports\/[^/]+\.xml$/); - const bytes = fs.readFileSync(path.join(root, asset.file)); - assert.equal( - createHash("sha256").update(bytes).digest("hex"), - asset.sha256, - ); - } + const files = fs.existsSync(path.join(root, "native")) + ? fs + .readdirSync(path.join(root, "native")) + .map((file) => path.join(root, "native", file)) + : []; const text = files .map((file) => fs.readFileSync(file, "utf8")) .join("\n"); @@ -47,22 +42,13 @@ class PublishedReports { files.length || result.errors.length, "Missing native evidence must remain an error", ); - const retained = fs - .readdirSync(root, { recursive: true }) - .filter((file) => fs.statSync(path.join(root, file)).isFile()) - .sort(); - assert.deepEqual( - retained, - ["result.json", ...result.assets.map((asset) => asset.file)].sort(), - ); return { directory: root, artifact, files, text, result }; }); } async negativeFixtures() { - const directory = process.env.EVIDENCE_DIRECTORY; const count = fs - .readdirSync(directory, { recursive: true }) - .filter((file) => path.basename(file) === "result.json").length; + .readdirSync(process.env.EVIDENCE_DIRECTORY, { recursive: true }) + .filter((file) => path.basename(file) === "report.json").length; return (await this.read(count)) .filter(({ result }) => result.outcome !== "success") .map(({ artifact }) => artifact.id) From 16048b7a5bb3bd45190ab941ba35813f93387a65 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 18:31:01 +0100 Subject: [PATCH 18/26] fix(reports): align artifacts with validated common publication --- .github/workflows/__shared-ci.yml | 6 +- .../__test-actions-ansible-test-molecule.yml | 63 +++++++++---------- .../workflows/__test-actions-ansible-test.yml | 27 +++++--- .../__test-actions-opentofu-test.yml | 15 +++-- .../__test-actions-retain-native-reports.yml | 6 +- .../workflows/__test-actions-vm-create.yml | 2 +- .../workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 25 +++++--- actions/retain-native-reports/README.md | 2 +- actions/retain-native-reports/action.yml | 2 +- tests/helpers/published-reports.cjs | 24 +------ 11 files changed, 83 insertions(+), 91 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index e70bb3b..6336f9a 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - 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 @@ -98,6 +98,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-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index c48b794..9968eed 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - 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 @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -68,24 +68,28 @@ jobs: EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 MOLECULE_TEST_DIRECTORY: ${{ runner.temp }}/molecule-local SCENARIO_OUTCOME: ${{ steps.scenario.outcome }} + NEGATIVE_ARTIFACT_IDS: ${{ steps.scenario.outcome == 'failure' && + steps.scenario.outputs.report-artifact-id || '' }} with: script: | const fs = require('node:fs'); const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); - const published = new PublishedReports(github, context); + const published = new PublishedReports(context); const expected = process.env.MOLECULE_TEST_RESULT === 'success' ? 'success' : 'failure'; assert.equal(process.env.SCENARIO_OUTCOME, expected); assert.equal(fs.existsSync(process.env.MOLECULE_TEST_DIRECTORY), false); const [report] = await published.read(1); - assert.ok(report.files.every(file => !file.endsWith('/scenario.xml'))); + assert.ok(report.files.every(file => !file.endsWith('-scenario.xml'))); assert.equal(report.result.outcome, expected); - core.setOutput('negative-fixtures', await published.negativeFixtures()); + core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: - artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures }} + artifact-ids: ${{ + steps.verify-ansible-test-molecule-local.outputs.negative-fixtures + }} vm: runs-on: ubuntu-latest timeout-minutes: 25 @@ -134,7 +138,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -149,7 +153,7 @@ jobs: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); - const published = new PublishedReports(github, context); + const published = new PublishedReports(context); assert.equal(process.env.SUCCESS, 'success'); await published.read(1); @@ -165,26 +169,6 @@ jobs: molecule-scenario: tests/fixture/molecule/smoke ansible-requirements: tests/fixture/ansible/requirements.txt - - name: Arrange - Download vm native-artifacts-2 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) - with: - artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }} - path: ${{ runner.temp }}/native-artifacts-2 - if: ${{ !cancelled() }} - - name: Assert - Check Molecule assertion failure and reports - if: ${{ !cancelled() && steps.vm.outcome == 'success' }} - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - env: - EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-2 - ASSERTION_FAILURE: ${{ steps.molecule-assertion-failure.outcome }} - with: - script: | - const assert = require('node:assert/strict'); - const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); - const published = new PublishedReports(github, context); - assert.equal(process.env.ASSERTION_FAILURE, 'failure'); - await published.read(2); - - name: Act - Test Molecule idempotence-failure id: molecule-idempotence-failure if: ${{ !cancelled() && steps.vm.outcome == 'success' }} @@ -198,9 +182,12 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: - artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ steps.molecule-idempotence-failure.outputs.report-artifact-id }} + artifact-ids: + ${{ steps.molecule-success.outputs.report-artifact-id }},${{ + steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ + steps.molecule-idempotence-failure.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-3 if: ${{ !cancelled() }} - name: Assert - Check Molecule idempotence failure and reports @@ -210,19 +197,25 @@ jobs: env: EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-3 IDEMPOTENCE_FAILURE: ${{ steps.molecule-idempotence-failure.outcome }} + NEGATIVE_ARTIFACT_IDS: ${{ + steps.molecule-assertion-failure.outputs.report-artifact-id }},${{ + steps.molecule-idempotence-failure.outputs.report-artifact-id }} + ASSERTION_FAILURE: ${{ steps.molecule-assertion-failure.outcome }} with: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); - const published = new PublishedReports(github, context); + const published = new PublishedReports(context); + assert.equal(process.env.ASSERTION_FAILURE, 'failure'); assert.equal(process.env.IDEMPOTENCE_FAILURE, 'failure'); await published.read(3); - core.setOutput('negative-fixtures', await published.negativeFixtures()); + core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: - artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} + artifact-ids: ${{ + steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} # Fixture teardown is intentionally repeated; action assertions remain above. # jscpd:ignore-start - name: Cleanup - Destroy direct QEMU guest diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index fa94301..bac84db 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - 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 @@ -66,14 +66,19 @@ jobs: FIXTURE_RESULT: ${{ matrix.result }} with: ansible-requirements: tests/fixture/ansible/requirements.txt - python-version-file: ${{ matrix.mode == 'playbook' && 'tests/fixture/ansible/.python-version' || '' }} - ansible-config: ${{ matrix.mode == 'playbook' && 'tests/fixture/ansible/ansible.cfg' || '' }} - test-playbook: ${{ matrix.mode == 'playbook' && 'tests/fixture/ansible/valid.yml' || '' }} - collection: ${{ matrix.mode == 'sanity' && 'tests/fixture/ansible/ansible_collections/example/smoke' || '' }} - target-python-version: ${{ matrix.mode == 'sanity' && steps.fixture.outputs.python-version || '' }} + python-version-file: ${{ matrix.mode == 'playbook' && + 'tests/fixture/ansible/.python-version' || '' }} + ansible-config: ${{ matrix.mode == 'playbook' && + 'tests/fixture/ansible/ansible.cfg' || '' }} + test-playbook: ${{ matrix.mode == 'playbook' && + 'tests/fixture/ansible/valid.yml' || '' }} + collection: ${{ matrix.mode == 'sanity' && + 'tests/fixture/ansible/ansible_collections/example/smoke' || '' }} + target-python-version: ${{ matrix.mode == 'sanity' && + steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -85,19 +90,21 @@ jobs: EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 EXPECTED: ${{ matrix.result }} OUTCOME: ${{ steps.test.outcome }} + NEGATIVE_ARTIFACT_IDS: ${{ steps.test.outcome == 'failure' && + steps.test.outputs.report-artifact-id || '' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); - const published = new PublishedReports(github, context); + const published = new PublishedReports(context); assert.equal(process.env.OUTCOME, process.env.EXPECTED); const [report] = await published.read(1); assert.ok(report.files.every(file => file.endsWith('.xml'))); assert.equal(/<(?:failure|error)\b/.test(report.text), process.env.EXPECTED === 'failure'); - core.setOutput('negative-fixtures', await published.negativeFixtures()); + core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 46d8324..150b861 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - 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 @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -72,24 +72,27 @@ jobs: EVIDENCE_DIRECTORY: ${{ runner.temp }}/native-artifacts-0 SCENARIO: ${{ matrix.result }} OUTCOME: ${{ steps.opentofu-tests.outcome }} + NEGATIVE_ARTIFACT_IDS: + ${{ steps.opentofu-tests.outcome == 'failure' && + steps.opentofu-tests.outputs.report-artifact-id || '' }} with: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); const success = process.env.SCENARIO === 'success'; assert.equal(process.env.OUTCOME, success ? 'success' : 'failure'); - const published = new PublishedReports(github, context); + const published = new PublishedReports(context); const [report] = await published.read(1); - assert.deepEqual(report.files.map(file => require('node:path').basename(file)), process.env.SCENARIO === 'init-failure' ? [] : ['opentofu.junit.xml']); + assert.deepEqual(report.files.map(file => require('node:path').basename(file)), process.env.SCENARIO === 'init-failure' ? [] : ['1-opentofu.junit.xml']); assert.equal(report.result.outcome, success ? 'success' : 'failure'); assert.equal(/<(?:failure|error)\b/.test(report.text), process.env.SCENARIO === 'assertion-failure'); assert.ok(!report.text.includes('synthetic-native-test')); if (success) { assert.match(report.text, /apply_and_read/); } - core.setOutput('negative-fixtures', await published.negativeFixtures()); + core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index 4b55ef6..eadd9d8 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - 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: working-directory: actions/retain-native-reports command: test:ci @@ -56,7 +56,7 @@ jobs: fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts @@ -68,7 +68,7 @@ jobs: script: | const assert = require('node:assert/strict'); const {PublishedReports} = require('./tests/helpers/published-reports.cjs'); - const [report] = await new PublishedReports(github, context).read(1); + const [report] = await new PublishedReports(context).read(1); assert.equal(report.result.outcome, 'success'); assert.deepEqual(report.result.errors, []); assert.deepEqual(report.files.map(file => require('node:path').basename(file)), ['1-native.xml']); diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index b80bebb..05b1947 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - 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-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index bb6813a..d516d8d 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - 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-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 1474e31..3c3acf6 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - 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 @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -93,10 +93,10 @@ jobs: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); - const published = new PublishedReports(github, context); + const published = new PublishedReports(context); assert.equal(process.env.OUTCOME, 'success'); const reports = await published.read(1); - assert.ok(reports.some(report => report.files.some(file => file.endsWith('/goss.xml')))); + assert.ok(reports.some(report => report.files.some(file => file.endsWith('/1-goss.xml')))); - name: Act - Validate invalid suite if: ${{ !cancelled() && steps.vm.outcome == 'success' }} id: invalid @@ -128,9 +128,12 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: - artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ steps.empty.outputs.report-artifact-id }},${{ steps.timeout.outputs.report-artifact-id }} + artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ + steps.invalid.outputs.report-artifact-id }},${{ + steps.empty.outputs.report-artifact-id }},${{ + steps.timeout.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 if: ${{ !cancelled() }} - name: Assert - Check failed suites and independent native artifacts @@ -143,20 +146,24 @@ jobs: EMPTY: ${{ steps.empty.outcome }} TIMEOUT: ${{ steps.timeout.outcome }} BACKEND: ${{ matrix.backend }} + NEGATIVE_ARTIFACT_IDS: + ${{ steps.invalid.outputs.report-artifact-id }},${{ + steps.empty.outputs.report-artifact-id }},${{ + steps.timeout.outputs.report-artifact-id }} with: script: | const assert = require('node:assert/strict'); const { PublishedReports } = require('./tests/helpers/published-reports.cjs'); for (const outcome of [process.env.INVALID, process.env.EMPTY, process.env.TIMEOUT]) assert.equal(outcome, 'failure'); - const published = new PublishedReports(github, context); + const published = new PublishedReports(context); const reports = await published.read(4); assert.equal(reports.filter(report => report.result.outcome === 'failure').length, 3); assert.ok(reports.some(report => report.text.includes('iac-missing-synthetic-file'))); - core.setOutput('negative-fixtures', await published.negativeFixtures()); + core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@2654703ceb0e0e04f240e8582f4b810bd1738f8d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/retain-native-reports/README.md b/actions/retain-native-reports/README.md index 02d4dc9..8b2d104 100644 --- a/actions/retain-native-reports/README.md +++ b/actions/retain-native-reports/README.md @@ -25,7 +25,7 @@ The common reporting workflow owns consolidated publication. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@5ede6dd791fa46005bf4bd67a801daa91904736a # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@a097f61bb3453c96cef27df54bb737797ec3ddb7 # refactor/unified-ci-reporting with: # Newline-separated native report paths selected by the producer. # This input is required. diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index 478f0ab..b332398 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -38,7 +38,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), directory); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.definition }} directory: ${{ steps.stage.outputs.directory }} diff --git a/tests/helpers/published-reports.cjs b/tests/helpers/published-reports.cjs index 2ea763d..970d9d8 100644 --- a/tests/helpers/published-reports.cjs +++ b/tests/helpers/published-reports.cjs @@ -4,8 +4,8 @@ const path = require("node:path"); // Inspect the bytes downloaded by the public artifact action. class PublishedReports { - constructor(github, context) { - Object.assign(this, { github, context }); + constructor(context) { + this.context = context; } async read(expectedCount) { const directory = process.env.EVIDENCE_DIRECTORY; @@ -13,10 +13,6 @@ class PublishedReports { .readdirSync(directory, { recursive: true }) .filter((file) => path.basename(file) === "report.json"); assert.equal(manifests.length, expectedCount); - const artifacts = await this.github.paginate( - this.github.rest.actions.listWorkflowRunArtifacts, - { ...this.context.repo, run_id: this.context.runId, per_page: 100 }, - ); return manifests.map((file) => { const root = path.dirname(path.join(directory, file)); const result = JSON.parse( @@ -24,11 +20,6 @@ class PublishedReports { ); assert.equal(result.version, 1); assert.equal(result.run, String(this.context.runId)); - const artifact = artifacts.find( - (item) => item.name === result.artifactName, - ); - assert.ok(artifact); - assert.equal(artifact.expired, false); const files = fs.existsSync(path.join(root, "native")) ? fs .readdirSync(path.join(root, "native")) @@ -42,17 +33,8 @@ class PublishedReports { files.length || result.errors.length, "Missing native evidence must remain an error", ); - return { directory: root, artifact, files, text, result }; + return { directory: root, files, text, result }; }); } - async negativeFixtures() { - const count = fs - .readdirSync(process.env.EVIDENCE_DIRECTORY, { recursive: true }) - .filter((file) => path.basename(file) === "report.json").length; - return (await this.read(count)) - .filter(({ result }) => result.outcome !== "success") - .map(({ artifact }) => artifact.id) - .join(","); - } } module.exports = { PublishedReports }; From 4f5767a550308912c4b0d717eefefaae95bc85e9 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 18:57:36 +0100 Subject: [PATCH 19/26] fix(reports): adopt file-safe coverage and bounded publication --- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 12 ++++++------ .github/workflows/__test-actions-ansible-test.yml | 6 +++--- .github/workflows/__test-actions-opentofu-test.yml | 6 +++--- .../__test-actions-retain-native-reports.yml | 4 ++-- .github/workflows/__test-actions-vm-create.yml | 2 +- .github/workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 8 ++++---- actions/retain-native-reports/README.md | 2 +- actions/retain-native-reports/action.yml | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 6336f9a..2e60f51 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - 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 @@ -98,6 +98,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-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 9968eed..2bd96a2 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - 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 @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -85,7 +85,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures @@ -138,7 +138,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -182,7 +182,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ @@ -212,7 +212,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index bac84db..ed9c662 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - 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 @@ -78,7 +78,7 @@ jobs: steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -105,6 +105,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 150b861..1517f39 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - 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 @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -93,6 +93,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index eadd9d8..fdace7a 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - 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: working-directory: actions/retain-native-reports command: test:ci @@ -56,7 +56,7 @@ jobs: fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 05b1947..05e05bb 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - 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-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index d516d8d..c01b46c 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - 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-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 3c3acf6..acaeab9 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - 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 @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ @@ -163,7 +163,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@ae467050dbd6e92f8072b2dc9e898bc78d093e7d # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/retain-native-reports/README.md b/actions/retain-native-reports/README.md index 8b2d104..374e6c2 100644 --- a/actions/retain-native-reports/README.md +++ b/actions/retain-native-reports/README.md @@ -25,7 +25,7 @@ The common reporting workflow owns consolidated publication. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@a097f61bb3453c96cef27df54bb737797ec3ddb7 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@16048b7a5bb3bd45190ab941ba35813f93387a65 # refactor/unified-ci-reporting with: # Newline-separated native report paths selected by the producer. # This input is required. diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index b332398..b49cf74 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -38,7 +38,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), directory); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.definition }} directory: ${{ steps.stage.outputs.directory }} From d97aa41aff6d8ab3b7a4cb511240ec0dec2df484 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 19:27:25 +0100 Subject: [PATCH 20/26] fix(reports): update common reporting dependency --- .github/workflows/__shared-ci.yml | 6 +++--- .../__test-actions-ansible-test-molecule.yml | 12 ++++++------ .github/workflows/__test-actions-ansible-test.yml | 6 +++--- .github/workflows/__test-actions-opentofu-test.yml | 6 +++--- .../__test-actions-retain-native-reports.yml | 4 ++-- .github/workflows/__test-actions-vm-create.yml | 2 +- .github/workflows/__test-actions-vm-destroy.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 8 ++++---- actions/retain-native-reports/README.md | 2 +- actions/retain-native-reports/action.yml | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 2e60f51..a6ba7bb 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ 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) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - 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 @@ -98,6 +98,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-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 2bd96a2..16c085d 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - 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 @@ -55,7 +55,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -85,7 +85,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures @@ -138,7 +138,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -182,7 +182,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ @@ -212,7 +212,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index ed9c662..17094e5 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - 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 @@ -78,7 +78,7 @@ jobs: steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -105,6 +105,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 1517f39..ef9864d 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,7 +16,7 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - 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 @@ -59,7 +59,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -93,6 +93,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index fdace7a..54c0544 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,7 +16,7 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - 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: working-directory: actions/retain-native-reports command: test:ci @@ -56,7 +56,7 @@ jobs: fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 05e05bb..2a244f2 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - 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-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index c01b46c..531e287 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - 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-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index acaeab9..b6f1632 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - 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 @@ -78,7 +78,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +128,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ @@ -163,7 +163,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@58e2dc7aef918536d5c801d9ec2032694ce586d1 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/retain-native-reports/README.md b/actions/retain-native-reports/README.md index 374e6c2..e29d6aa 100644 --- a/actions/retain-native-reports/README.md +++ b/actions/retain-native-reports/README.md @@ -25,7 +25,7 @@ The common reporting workflow owns consolidated publication. ## Usage ```yaml -- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@16048b7a5bb3bd45190ab941ba35813f93387a65 # refactor/unified-ci-reporting +- uses: hoverkraft-tech/ci-github-iac/actions/retain-native-reports@4f5767a550308912c4b0d717eefefaae95bc85e9 # refactor/unified-ci-reporting with: # Newline-separated native report paths selected by the producer. # This input is required. diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index b49cf74..4dc0a38 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -38,7 +38,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), directory); - id: reports if: ${{ !cancelled() }} - 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: ${{ inputs.definition }} directory: ${{ steps.stage.outputs.directory }} From ecfaf1da772e39538dccea99585a38f175d684fb Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 30 Nov 2026 19:41:12 +0100 Subject: [PATCH 21/26] fix(ci): handle delayed fixture artifact lookup --- .github/workflows/__test-actions-ansible-test-molecule.yml | 4 ++-- .github/workflows/__test-actions-ansible-test.yml | 2 +- .github/workflows/__test-actions-opentofu-test.yml | 2 +- .github/workflows/__test-actions-vm-test.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index 16c085d..fee7643 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -85,7 +85,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures @@ -212,7 +212,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 17094e5..76aed5d 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -105,6 +105,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index ef9864d..751f142 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -93,6 +93,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index b6f1632..2df3bd1 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -163,7 +163,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM From e25b9177c45e32910d7da526922b9f445fcea624 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 1 Dec 2026 09:26:29 +0100 Subject: [PATCH 22/26] refactor(ci): call shared completion workflow --- .github/workflows/__shared-ci.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index a6ba7bb..6c21ee5 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -94,10 +94,7 @@ jobs: test-retain-native-reports, 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) }} From 0b1223fb48a002193e3d5b885040fa4821791a31 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 3 Dec 2026 14:14:26 +0100 Subject: [PATCH 23/26] ci: adopt separate test and lint report comments --- .github/workflows/__shared-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index 6c21ee5..fc41a34 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a57403ecded4ed077dc24a6574953f7c46e69224 # PR #683 (unreleased) with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@a57403ecded4ed077dc24a6574953f7c46e69224 # PR #683 (unreleased) permissions: actions: read contents: read From b85476bb67b4c895a5e358156ce7a7722219d6a6 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Thu, 3 Dec 2026 14:57:33 +0100 Subject: [PATCH 24/26] ci: display lint before tests in reports --- .github/workflows/__shared-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index fc41a34..f42c270 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@a57403ecded4ed077dc24a6574953f7c46e69224 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0ad84c70926a266244e95a652034fb098a4d5399 # PR #683 (unreleased) permissions: actions: read contents: read From 06e94aebb715f0ebc13317d1a220be83bf7e84d4 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Fri, 4 Dec 2026 14:40:22 +0100 Subject: [PATCH 25/26] ci: refresh reporting providers after Common 5.0.0 --- .github/workflows/__greetings.yml | 2 +- .github/workflows/__need-fix-to-issue.yml | 2 +- .github/workflows/__semantic-pull-request.yml | 2 +- .github/workflows/__shared-ci.yml | 6 +++--- .github/workflows/__stale.yml | 2 +- .../__test-actions-ansible-test-molecule.yml | 14 ++++++-------- .github/workflows/__test-actions-ansible-test.yml | 8 +++----- .github/workflows/__test-actions-opentofu-test.yml | 8 +++----- .../__test-actions-retain-native-reports.yml | 6 ++---- .github/workflows/__test-actions-vm-create.yml | 4 +--- .github/workflows/__test-actions-vm-destroy.yml | 4 +--- .github/workflows/__test-actions-vm-test.yml | 10 ++++------ actions/retain-native-reports/action.yml | 2 +- 13 files changed, 28 insertions(+), 42 deletions(-) diff --git a/.github/workflows/__greetings.yml b/.github/workflows/__greetings.yml index 32eac57..dd12b35 100644 --- a/.github/workflows/__greetings.yml +++ b/.github/workflows/__greetings.yml @@ -12,7 +12,7 @@ permissions: {} jobs: greetings: - uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: contents: read issues: write diff --git a/.github/workflows/__need-fix-to-issue.yml b/.github/workflows/__need-fix-to-issue.yml index c5aa356..91d1331 100644 --- a/.github/workflows/__need-fix-to-issue.yml +++ b/.github/workflows/__need-fix-to-issue.yml @@ -21,7 +21,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: contents: read issues: write diff --git a/.github/workflows/__semantic-pull-request.yml b/.github/workflows/__semantic-pull-request.yml index 36b014f..2122f61 100644 --- a/.github/workflows/__semantic-pull-request.yml +++ b/.github/workflows/__semantic-pull-request.yml @@ -14,4 +14,4 @@ jobs: main: permissions: contents: read - uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 diff --git a/.github/workflows/__shared-ci.yml b/.github/workflows/__shared-ci.yml index f42c270..6de20ba 100644 --- a/.github/workflows/__shared-ci.yml +++ b/.github/workflows/__shared-ci.yml @@ -8,7 +8,7 @@ permissions: {} jobs: linter: - uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a57403ecded4ed077dc24a6574953f7c46e69224 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: linter-env: | FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/ @@ -68,7 +68,7 @@ jobs: - test-molecule - test-opentofu - test-retain-native-reports - uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0ad84c70926a266244e95a652034fb098a4d5399 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: actions: read contents: read @@ -94,7 +94,7 @@ jobs: test-retain-native-reports, reports, ] - uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@cb86863a77462f8837b38ad542b49ab36a825a85 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: {} with: job-results: ${{ toJSON(needs) }} diff --git a/.github/workflows/__stale.yml b/.github/workflows/__stale.yml index 3fc7a3e..75a300e 100644 --- a/.github/workflows/__stale.yml +++ b/.github/workflows/__stale.yml @@ -9,7 +9,7 @@ permissions: {} jobs: main: - uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@d606f77fad305ef07dfde3db5270f5e324019c97 # 4.2.4 + uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 permissions: issues: write pull-requests: write diff --git a/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index fee7643..ae291f6 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,10 +19,8 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) with: - test-results: junit.xml - test-coverage: lcov.info working-directory: actions/ansible/test-molecule command: test:ci coverage: "true" @@ -55,7 +53,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt test-timeout-minutes: ${{ matrix.result == 'timeout' && '1' || '5' }} - name: Arrange - Download local native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.scenario.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -85,7 +83,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule local negative results if: steps.verify-ansible-test-molecule-local.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.verify-ansible-test-molecule-local.outputs.negative-fixtures @@ -138,7 +136,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-1 @@ -182,7 +180,7 @@ jobs: ansible-requirements: tests/fixture/ansible/requirements.txt - name: Arrange - Download vm native-artifacts-3 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.molecule-success.outputs.report-artifact-id }},${{ @@ -212,7 +210,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test-molecule vm negative results if: steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.verify-ansible-test-molecule-vm.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index 76aed5d..e712337 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,10 +19,8 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) with: - test-results: junit.xml - test-coverage: lcov.info working-directory: actions/ansible/test command: test:ci coverage: "true" @@ -78,7 +76,7 @@ jobs: steps.fixture.outputs.python-version || '' }} sanity-image: ${{ matrix.sanity-image || '' }} - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.test.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -105,6 +103,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard ansible-test scenarios negative results if: steps.verify-ansible-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.verify-ansible-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index 751f142..f5dc64a 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,10 +16,8 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) with: - test-results: junit.xml - test-coverage: lcov.info working-directory: actions/opentofu/test command: test:ci coverage: "true" @@ -59,7 +57,7 @@ jobs: working-directory: tests/fixture/opentofu tofu-version-file: tests/fixture/opentofu/.opentofu-version - name: Arrange - Download scenarios native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.opentofu-tests.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -93,6 +91,6 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard opentofu-test scenarios negative results if: steps.verify-opentofu-test-scenarios.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.verify-opentofu-test-scenarios.outputs.negative-fixtures }} diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index 54c0544..d7c3896 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,12 +16,10 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) with: working-directory: actions/retain-native-reports command: test:ci - test-results: junit.xml - test-coverage: lcov.info coverage: "true" retain: runs-on: ubuntu-latest @@ -56,7 +54,7 @@ jobs: fixture","reports":[{"kind":"test","pattern":"native.xml"}]}' outcome: success - name: Arrange - Download retained evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.retain.outputs.artifact-id }} path: ${{ runner.temp }}/native-retention-artifacts diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 2a244f2..1a03406 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,10 +19,8 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) with: - test-results: junit.xml - test-coverage: lcov.info working-directory: actions/vm/create command: test:ci coverage: "true" diff --git a/.github/workflows/__test-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index 531e287..52906ea 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,10 +19,8 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) with: - test-results: junit.xml - test-coverage: lcov.info working-directory: actions/vm/destroy command: test:ci coverage: "true" diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 2df3bd1..096d0be 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,10 +19,8 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@3ba26a82aae406c87bb99c80dfe46299fc808cbb # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) with: - test-results: junit.xml - test-coverage: lcov.info working-directory: actions/vm/test command: test:ci coverage: "true" @@ -78,7 +76,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-0 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }} path: ${{ runner.temp }}/native-artifacts-0 @@ -128,7 +126,7 @@ jobs: goss-vars: tests/fixture/goss/vars.json test-timeout-minutes: 1 - name: Arrange - Download guest native-artifacts-1 evidence - uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/download-artifact@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.valid.outputs.report-artifact-id }},${{ steps.invalid.outputs.report-artifact-id }},${{ @@ -163,7 +161,7 @@ jobs: core.setOutput('negative-fixtures', process.env.NEGATIVE_ARTIFACT_IDS); - name: Cleanup - Discard vm-test guest negative results if: steps.verify-vm-test-guest.outputs.negative-fixtures != '' - uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: artifact-ids: ${{ steps.verify-vm-test-guest.outputs.negative-fixtures }} - name: Cleanup - Destroy VM diff --git a/actions/retain-native-reports/action.yml b/actions/retain-native-reports/action.yml index 4dc0a38..50e3732 100644 --- a/actions/retain-native-reports/action.yml +++ b/actions/retain-native-reports/action.yml @@ -38,7 +38,7 @@ runs: stageNativeReports(process.env.NATIVE_REPORTS.split(/\r?\n/).filter(Boolean), directory); - id: reports if: ${{ !cancelled() }} - uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased) + uses: hoverkraft-tech/ci-github-common/actions/quality/prepare-ci-reports@26f3d6878844ec53849eec6ac75af8d14ea402e9 # 5.0.0 with: definition: ${{ inputs.definition }} directory: ${{ steps.stage.outputs.directory }} From b79ce5da289a3ebee5da8359cf657e2c93759de7 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Sat, 5 Dec 2026 09:07:56 +0100 Subject: [PATCH 26/26] refactor(devx): simplify action development commands --- .../__test-actions-ansible-test-molecule.yml | 5 +- .../workflows/__test-actions-ansible-test.yml | 5 +- .../__test-actions-opentofu-test.yml | 5 +- .../__test-actions-retain-native-reports.yml | 5 +- .../workflows/__test-actions-vm-create.yml | 5 +- .../workflows/__test-actions-vm-destroy.yml | 5 +- .github/workflows/__test-actions-vm-test.yml | 5 +- CONTRIBUTING.md | 12 +++-- Makefile | 52 ++++++++++++++----- actions/ansible/test-molecule/package.json | 3 +- actions/ansible/test/package.json | 3 +- actions/opentofu/test/package.json | 3 +- actions/retain-native-reports/package.json | 3 +- actions/vm/create/package.json | 3 +- actions/vm/destroy/package.json | 3 +- actions/vm/test/package.json | 3 +- 16 files changed, 75 insertions(+), 45 deletions(-) diff --git a/.github/workflows/__test-actions-ansible-test-molecule.yml b/.github/workflows/__test-actions-ansible-test-molecule.yml index ae291f6..f06bb5d 100644 --- a/.github/workflows/__test-actions-ansible-test-molecule.yml +++ b/.github/workflows/__test-actions-ansible-test-molecule.yml @@ -19,11 +19,12 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test-molecule unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@133df96fa31a002107174959beafa09808597051 # PR #624 (unreleased) with: working-directory: actions/ansible/test-molecule - command: test:ci + engine: node:test coverage: "true" + arguments: '["--test-coverage-exclude=**/tests/**","--test-coverage-include=*.cjs"]' local: runs-on: ubuntu-latest timeout-minutes: 12 diff --git a/.github/workflows/__test-actions-ansible-test.yml b/.github/workflows/__test-actions-ansible-test.yml index e712337..378b808 100644 --- a/.github/workflows/__test-actions-ansible-test.yml +++ b/.github/workflows/__test-actions-ansible-test.yml @@ -19,11 +19,12 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run ansible/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@133df96fa31a002107174959beafa09808597051 # PR #624 (unreleased) with: working-directory: actions/ansible/test - command: test:ci + engine: node:test coverage: "true" + arguments: '["--test-coverage-exclude=**/tests/**","--test-coverage-include=*.cjs"]' scenarios: runs-on: ubuntu-latest timeout-minutes: 30 diff --git a/.github/workflows/__test-actions-opentofu-test.yml b/.github/workflows/__test-actions-opentofu-test.yml index f5dc64a..0f9066d 100644 --- a/.github/workflows/__test-actions-opentofu-test.yml +++ b/.github/workflows/__test-actions-opentofu-test.yml @@ -16,11 +16,12 @@ jobs: with: persist-credentials: false - name: Act - Test native report validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@133df96fa31a002107174959beafa09808597051 # PR #624 (unreleased) with: working-directory: actions/opentofu/test - command: test:ci + engine: node:test coverage: "true" + arguments: '["--test-coverage-exclude=**/tests/**","--test-coverage-include=*.cjs"]' scenarios: runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/.github/workflows/__test-actions-retain-native-reports.yml b/.github/workflows/__test-actions-retain-native-reports.yml index d7c3896..e110173 100644 --- a/.github/workflows/__test-actions-retain-native-reports.yml +++ b/.github/workflows/__test-actions-retain-native-reports.yml @@ -16,11 +16,12 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Act - Verify staging validation - uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@133df96fa31a002107174959beafa09808597051 # PR #624 (unreleased) with: working-directory: actions/retain-native-reports - command: test:ci + engine: node:test coverage: "true" + arguments: '["--test-coverage-exclude=**/tests/**","--test-coverage-include=*.cjs"]' retain: runs-on: ubuntu-latest timeout-minutes: 5 diff --git a/.github/workflows/__test-actions-vm-create.yml b/.github/workflows/__test-actions-vm-create.yml index 1a03406..679bd69 100644 --- a/.github/workflows/__test-actions-vm-create.yml +++ b/.github/workflows/__test-actions-vm-create.yml @@ -19,11 +19,12 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/create unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@133df96fa31a002107174959beafa09808597051 # PR #624 (unreleased) with: working-directory: actions/vm/create - command: test:ci + engine: node:test coverage: "true" + arguments: '["--test-coverage-exclude=**/tests/**","--test-coverage-include=*.cjs","--test-coverage-include=../_internal/command.cjs","--test-coverage-include=../_internal/workspace.cjs"]' startup: runs-on: ubuntu-latest timeout-minutes: 20 diff --git a/.github/workflows/__test-actions-vm-destroy.yml b/.github/workflows/__test-actions-vm-destroy.yml index 52906ea..cedbce7 100644 --- a/.github/workflows/__test-actions-vm-destroy.yml +++ b/.github/workflows/__test-actions-vm-destroy.yml @@ -19,11 +19,12 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/destroy unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@133df96fa31a002107174959beafa09808597051 # PR #624 (unreleased) with: working-directory: actions/vm/destroy - command: test:ci + engine: node:test coverage: "true" + arguments: '["--test-coverage-exclude=**/tests/**","--test-coverage-include=../_internal/runtime.cjs"]' deletion: runs-on: ubuntu-latest timeout-minutes: 20 diff --git a/.github/workflows/__test-actions-vm-test.yml b/.github/workflows/__test-actions-vm-test.yml index 096d0be..bc00aad 100644 --- a/.github/workflows/__test-actions-vm-test.yml +++ b/.github/workflows/__test-actions-vm-test.yml @@ -19,11 +19,12 @@ jobs: persist-credentials: false # jscpd:ignore-end - name: Act - Run vm/test unit tests - uses: hoverkraft-tech/ci-github-nodejs/actions/test@a52b36c38477c7e8419c6e8ac582bc51df906228 # PR #624 (unreleased) + uses: hoverkraft-tech/ci-github-nodejs/actions/test@133df96fa31a002107174959beafa09808597051 # PR #624 (unreleased) with: working-directory: actions/vm/test - command: test:ci + engine: node:test coverage: "true" + arguments: '["--test-coverage-exclude=**/tests/**","--test-coverage-include=*.cjs"]' guest: runs-on: ubuntu-latest timeout-minutes: 25 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dee3721..f36c1a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -100,11 +100,13 @@ Each action owns a private `package.json`, lockfile, `.node-version` and `tests/ directory. Development dependencies supply the same Toolkit helpers injected by the pinned GitHub Script action; production scripts receive them from the caller. For example, run `npm --prefix actions/vm/create ci` followed by -`npm --prefix actions/vm/create test` for creation tests. Hosted unit jobs run -`npm run test:ci`: the command writes console output, JUnit and LCOV into the fresh `CI_REPORTS_DIR`, -with coverage enabled only when `CI_TEST_COVERAGE` is true. -Generated coverage files are gitignored. `make test` discovers the action packages, -installs their locked test dependencies and runs each suite, stopping on failure. +`npm --prefix actions/vm/create test` for creation tests. Hosted unit jobs use +the Node test action's `node:test` preset, which configures native results and +coverage. Native arguments preserve each suite's coverage scope. +Generated coverage files are gitignored. `make setup` installs locked action +dependencies; `make test` runs each suite and stops on failure. `make build` runs +available build scripts. `make ci` installs, tests, checks generated distributions +when present and lints without applying fixes. Keep fixes in `make lint-fix`. Keep reusable test helpers in `tests/helpers/` and synthetic inputs in `tests/fixture/`. Keep single-use setup beside its tests; avoid adding test harnesses that parse action YAML or emulate the GitHub Script runtime. The public actions require no npm installation diff --git a/Makefile b/Makefile index da36293..af0eef6 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,17 @@ +GIT_COMMON_DIR := $(shell git rev-parse --path-format=absolute --git-common-dir) + SHELL := /bin/bash .DEFAULT_GOAL := help +.PHONY: help lint lint-fix docs setup test build check-distributions deps-audit ci + +ACTION_PACKAGES := $(sort $(patsubst %/package.json,%,$(shell find actions -name node_modules -prune -o -name dist -prune -o -name package.json -print))) HOST_UID := $(shell id -u) HOST_GID := $(shell id -g) -.PHONY: help lint-fix ci test lint docs help: ## Display help @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -test: ## Run unit tests - @set -eu; \ - for manifest in $(wildcard actions/*/package.json actions/*/*/package.json); do \ - npm --prefix "$${manifest%/package.json}" ci --ignore-scripts --no-audit --no-fund; \ - npm --prefix "$${manifest%/package.json}" test; \ - done - lint: ## Execute linting $(call run_linter,) @@ -30,10 +27,6 @@ lint-fix: ## Execute linting and fix -e FIX_SHELL_SHFMT=true \ ) -ci: ## Execute local CI tasks - $(MAKE) lint-fix - $(MAKE) test - docs: ## Generate action and public workflow documentation @set -eu; \ GITHUB_TOKEN="$$(gh auth token)"; \ @@ -48,6 +41,32 @@ docs: ## Generate action and public workflow documentation ############################# # Helpers ############################# +setup: ## Install locked action development dependencies + $(call run_npm_for_packages,ci --ignore-scripts --no-audit --no-fund) + +test: ## Run action source tests + $(call run_npm_for_packages,test) + +build: ## Rebuild action distributions where present + $(call run_npm_for_packages,run --if-present build) + +check-distributions: build ## Verify committed distributions match their source + @set -eu; changes="$$(git status --porcelain --untracked-files=all -- ':(glob)actions/**/dist/**')"; \ + if [ -n "$$changes" ]; then \ + printf '%s\n' "$$changes"; \ + echo 'Run make build and commit the generated distributions.' >&2; \ + exit 1; \ + fi + +deps-audit: ## Check action dependencies without changing lockfiles + $(call run_npm_for_packages,audit) + +ci: ## Install dependencies and run checks without applying fixes + $(MAKE) setup + $(MAKE) test + $(MAKE) check-distributions + $(MAKE) lint + define run_linter @set -eu; \ DEFAULT_WORKSPACE="$(CURDIR)"; \ @@ -58,10 +77,12 @@ define run_linter --build-arg UID=$(HOST_UID) --build-arg GID=$(HOST_GID) \ --tag "$$LINTER_IMAGE" .; \ docker run --platform=linux/amd64 \ + -v "$(GIT_COMMON_DIR):$(GIT_COMMON_DIR):ro" \ -v "$$VOLUME" --rm \ -e RUN_LOCAL=true \ -e DEFAULT_WORKSPACE="$$DEFAULT_WORKSPACE" \ -e DEFAULT_BRANCH="$$DEFAULT_BRANCH" \ + -e IGNORE_GITIGNORED_FILES=true \ -e USE_FIND_ALGORITHM=false \ -e FILTER_REGEX_INCLUDE="$(filter-out $@,$(MAKECMDGOALS))" \ -e 'FILTER_REGEX_EXCLUDE=/(\.cache|\.reports)/' \ @@ -76,3 +97,10 @@ ifneq ($(filter lint lint-fix,$(firstword $(MAKECMDGOALS))),) %: @: endif + +define run_npm_for_packages + @set -eu; \ + for directory in $(ACTION_PACKAGES); do \ + npm --prefix "$$directory" $(1); \ + done +endef diff --git a/actions/ansible/test-molecule/package.json b/actions/ansible/test-molecule/package.json index 9388fb1..5c89b8e 100644 --- a/actions/ansible/test-molecule/package.json +++ b/actions/ansible/test-molecule/package.json @@ -8,8 +8,7 @@ "node": ">=24.8.0" }, "scripts": { - "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test": "node --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/ansible/test/package.json b/actions/ansible/test/package.json index c9cfe6a..1db4f78 100644 --- a/actions/ansible/test/package.json +++ b/actions/ansible/test/package.json @@ -8,8 +8,7 @@ "node": ">=24.8.0" }, "scripts": { - "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test": "node --test" }, "devDependencies": { "@actions/glob": "0.7.0" diff --git a/actions/opentofu/test/package.json b/actions/opentofu/test/package.json index 31898e6..b4ea243 100644 --- a/actions/opentofu/test/package.json +++ b/actions/opentofu/test/package.json @@ -8,7 +8,6 @@ "node": ">=24.8.0" }, "scripts": { - "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test": "node --test" } } diff --git a/actions/retain-native-reports/package.json b/actions/retain-native-reports/package.json index 988ff8d..8b5329b 100644 --- a/actions/retain-native-reports/package.json +++ b/actions/retain-native-reports/package.json @@ -8,7 +8,6 @@ "node": ">=24.8.0" }, "scripts": { - "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test": "node --test" } } diff --git a/actions/vm/create/package.json b/actions/vm/create/package.json index c506dc8..5a3b9b3 100644 --- a/actions/vm/create/package.json +++ b/actions/vm/create/package.json @@ -8,8 +8,7 @@ "node": ">=24.8.0" }, "scripts": { - "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-coverage-include='../_internal/command.cjs' --test-coverage-include='../_internal/workspace.cjs' --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test": "node --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/vm/destroy/package.json b/actions/vm/destroy/package.json index c49f243..b108727 100644 --- a/actions/vm/destroy/package.json +++ b/actions/vm/destroy/package.json @@ -8,8 +8,7 @@ "node": ">=24.8.0" }, "scripts": { - "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='../_internal/runtime.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test": "node --test" }, "devDependencies": { "@actions/exec": "3.0.0", diff --git a/actions/vm/test/package.json b/actions/vm/test/package.json index f158cf4..cef9c0e 100644 --- a/actions/vm/test/package.json +++ b/actions/vm/test/package.json @@ -8,8 +8,7 @@ "node": ">=24.8.0" }, "scripts": { - "test": "node --test", - "test:ci": "node --test-coverage-exclude='**/tests/**' --test-coverage-include='*.cjs' --test-reporter=junit --test-reporter-destination=\"$CI_REPORTS_DIR/junit.xml\" $(test \"$CI_TEST_COVERAGE\" = true && printf %s --experimental-test-coverage) --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=\"$CI_REPORTS_DIR/lcov.info\" --test" + "test": "node --test" }, "devDependencies": { "@actions/exec": "3.0.0",