Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5e42c4f
feat(coverage): support native GitHub Code Quality reports
neilime Nov 26, 2026
2a282b8
docs(coverage): regenerate action and workflow references
neilime Nov 26, 2026
8e0e745
fix(coverage): consume corrected collection and isolate previews
neilime Nov 26, 2026
3d2648e
feat(reports)!: adopt the shared CI report contract
neilime Nov 26, 2026
ac12295
fix(reports): align producer integration and generated usage
neilime Nov 26, 2026
d40c4f9
refactor!: adopt native CI reports and separate completion gate
neilime Nov 28, 2026
fc8b910
docs: regenerate PHP reporting contracts
neilime Nov 28, 2026
98ee759
docs: regenerate rebased PHP reporting usage
neilime Nov 28, 2026
352ade2
fix: validate report evidence with scoped fixture cleanup
neilime Nov 28, 2026
23dac6c
fix: expand report paths in Composer fixture commands
neilime Nov 28, 2026
138d451
ci: validate the final shared reporting contract
neilime Nov 28, 2026
abf3478
docs: identify the pinned Composer cache action release
neilime Nov 28, 2026
d1d31ff
ci: remove obsolete test comment permissions
neilime Nov 28, 2026
0c83446
fix(ci): adopt external coverage comment ownership
neilime Nov 29, 2026
03e4914
ci: adopt actionable reports and stable coverage project flags
neilime Nov 29, 2026
d654166
ci: update validated reporting implementation
neilime Nov 29, 2026
0babdc8
ci: use the corrected Common reporting actions
neilime Nov 29, 2026
f62e236
docs: refresh reporting action references
neilime Nov 29, 2026
644ef6e
docs: pin generated examples to the reporting preview
neilime Nov 29, 2026
8ccc340
ci: use bundled Node.js coverage conversion
neilime Nov 29, 2026
779dfb4
ci: validate composed report actions
neilime Nov 30, 2026
07564f9
refactor(ci): adopt standalone report publication actions
neilime Nov 30, 2026
96efe75
refactor(ci): adopt standalone report publication actions
neilime Nov 30, 2026
8b029e1
refactor(reports)!: compose common report preparation
neilime Nov 30, 2026
e2a3293
fix(reports): align artifacts with validated common publication
neilime Nov 30, 2026
8d512be
fix(reports): adopt file-safe coverage and bounded publication
neilime Nov 30, 2026
846c338
fix(reports): update common reporting dependency
neilime Nov 30, 2026
a9edb3c
fix(ci): handle delayed fixture artifact lookup
neilime Nov 30, 2026
86a1979
refactor(ci): call shared completion workflow
neilime Dec 1, 2026
7d630c7
chore: reconcile reporting changes with main
neilime Dec 1, 2026
e16c60e
refactor(ci): clarify artifact-only language workflows
neilime Dec 1, 2026
235ab12
ci: adopt separate test and lint report comments
neilime Dec 3, 2026
128f50b
ci: display lint before tests in reports
neilime Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/linters/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# FIXME: Remove only the code-quality exception when Actionlint supports it.
# https://github.com/rhysd/actionlint/pull/674
paths:
{
.github/workflows/__main-ci.yml:
{ ignore: [^unknown permission scope "code-quality"\.] },
.github/workflows/__pull-request-ci.yml:
{ ignore: [^unknown permission scope "code-quality"\.] },
.github/workflows/__release.yml:
{ ignore: [^unknown permission scope "code-quality"\.] },
.github/workflows/__shared-ci.yml:
{ ignore: [^unknown permission scope "code-quality"\.] },
}
25 changes: 20 additions & 5 deletions .github/workflows/__assert-report-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ on:
description: JSON mapping of expected report filenames to their SHA-256 hashes.
required: true
type: string
discard-fixture:
description: Remove intentionally failing fixture evidence after validation, so it does not become a real CI finding.
type: boolean
default: false
permissions: {}
jobs:
verify:
runs-on: ubuntu-latest
permissions:
actions: read
steps:
# Read artifacts after the producer finishes, as downstream consumers do.
- name: Assert - Download the native report artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
uses: hoverkraft-tech/ci-github-common/actions/download-artifact@23aa1846c8c6d829f321984b6d0252ebc36b01ee # PR #683 (unreleased)
with:
artifact-ids: ${{ inputs.artifact-id }}
path: downloaded-reports
Expand All @@ -31,10 +37,19 @@ jobs:
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const {createHash} = require('node:crypto');
const expected = JSON.parse(process.env.EXPECTED_REPORTS);
const files = await (await glob.create('downloaded-reports/**/*', {matchDirectories: false})).glob();
assert.deepEqual(files.map(file => path.basename(file)).sort(), Object.keys(expected).sort());
const manifest = JSON.parse(fs.readFileSync('downloaded-reports/report.json','utf8'));
assert.equal(manifest.version, 1);
const files = fs.existsSync('downloaded-reports/native') ? fs.readdirSync('downloaded-reports/native').map(file => path.join('downloaded-reports/native', file)) : [];
assert.equal(fs.existsSync('downloaded-reports/.private-fixture'),false);
assert.equal(manifest.errors.length > 0, Object.keys(expected).length === 0);
assert.deepEqual(files.map(file => path.basename(file).replace(/^\d+-/, '')).sort(), Object.keys(expected).sort());
for (const file of files) {
assert.equal(createHash('sha256').update(fs.readFileSync(file)).digest('hex'), expected[path.basename(file)]);
const bytes = fs.readFileSync(file);
assert.equal(bytes.includes('Must not be uploaded'), false);
}
- name: Cleanup - Remove verified negative fixture evidence
if: inputs.discard-fixture
uses: hoverkraft-tech/ci-github-common/actions/quality/discard-report-fixtures@1885f0a6b433228e28c0ea7df8d41bd5e2c24665 # PR #683 (unreleased)
with:
artifact-ids: ${{ inputs.artifact-id }}
1 change: 1 addition & 0 deletions .github/workflows/__main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
issues: write
packages: read
pull-requests: write
code-quality: write
release:
needs: ci
if: github.event_name != 'schedule'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/__pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
issues: write
packages: read
pull-requests: write
code-quality: write
1 change: 1 addition & 0 deletions .github/workflows/__release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
issues: write
security-events: write
statuses: write
code-quality: write

release:
name: Create and publish release
Expand Down
59 changes: 54 additions & 5 deletions .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
permissions: {}
jobs:
linter:
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@f165c0ca3e88604611481e1408ace1e0e3a5ee47 # 4.3.1
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@a57403ecded4ed077dc24a6574953f7c46e69224 # PR #683 (unreleased)
permissions:
actions: read
contents: read
statuses: write
issues: write
packages: read
pull-requests: write
actions: read
security-events: write
with:
linter-env: |-
Expand All @@ -22,24 +22,31 @@ jobs:
test-workflow-continuous-integration:
uses: $/.github/workflows/__test-workflow-continuous-integration.yml
permissions:
actions: read
contents: read
pull-requests: write
id-token: write
code-quality: write
test-action-get-php-versions:
uses: $/.github/workflows/__test-action-get-php-versions.yml
permissions:
actions: read
contents: read
id-token: write
test-action-setup-php:
uses: $/.github/workflows/__test-action-setup-php.yml
permissions:
actions: read
contents: read
test-action-package-test:
uses: $/.github/workflows/__test-action-package-test.yml
permissions:
actions: read
contents: read
test-workflow-release:
uses: $/.github/workflows/__test-workflow-release.yml
permissions:
actions: read
contents: read
test-action-test:
strategy:
Expand All @@ -48,7 +55,6 @@ jobs:
scenario:
[
reports,
publication-disabled,
preparation,
composer-command,
failing-command,
Expand All @@ -59,8 +65,8 @@ jobs:
with:
scenario: ${{ matrix.scenario }}
permissions:
actions: read
contents: read
pull-requests: write
test-action-lint:
strategy:
fail-fast: false
Expand All @@ -70,9 +76,52 @@ jobs:
with:
scenario: ${{ matrix.scenario }}
permissions:
actions: read
contents: read
pull-requests: write
test-workflow-documentation:
uses: $/.github/workflows/__test-workflow-documentation.yml
permissions:
actions: read
contents: read

reports:
if: always()
needs:
- linter
- test-workflow-continuous-integration
- test-action-get-php-versions
- test-action-setup-php
- test-action-package-test
- test-workflow-release
- test-action-test
- test-action-lint
- test-workflow-documentation
uses: hoverkraft-tech/ci-github-common/.github/workflows/publish-ci-reports.yml@0ad84c70926a266244e95a652034fb098a4d5399 # 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-workflow-continuous-integration
- test-action-get-php-versions
- test-action-setup-php
- test-action-package-test
- test-workflow-release
- test-action-test
- test-action-lint
- test-workflow-documentation
- reports
uses: hoverkraft-tech/ci-github-common/.github/workflows/check-jobs.yml@cb86863a77462f8837b38ad542b49ab36a825a85 # PR #683 (unreleased)
permissions: {}
with:
job-results: ${{ toJSON(needs) }}
3 changes: 3 additions & 0 deletions .github/workflows/__test-action-get-php-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
unit:
uses: $/.github/workflows/continuous-integration.yml
permissions:
actions: read
contents: read
id-token: write
with:
Expand All @@ -15,11 +16,13 @@ jobs:
integration:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Arrange - Composer is the only version declaration
run: |
rm .php-version
Expand Down
61 changes: 11 additions & 50 deletions .github/workflows/__test-action-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
lint:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
outputs:
report-artifact-id: ${{ steps.lint.outputs.report-artifact-id }}
Expand All @@ -20,6 +21,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Arrange - Configure native PHPStan reports
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
Expand All @@ -30,8 +32,10 @@ jobs:
await io.cp('tests/php-project', '.test-php-lint', {recursive: true});
const manifestPath = '.test-php-lint/composer.json';
const manifest = JSON.parse(await fs.readFile(manifestPath, 'utf8'));
if (process.env.SCENARIO !== 'no-reports') {
manifest.scripts['lint:ci'] = 'tools/vendor/bin/phpstan analyse src --level=max --no-progress --error-format=checkstyle > phpstan-checkstyle.xml';
if (process.env.SCENARIO === 'no-reports') {
manifest.scripts['lint:ci'] = 'tools/vendor/bin/phpstan analyse src --level=max --no-progress --error-format=github';
} else {
manifest.scripts['lint:ci'] = 'tools/vendor/bin/phpstan analyse src --level=max --no-progress --error-format=checkstyle > "$CI_REPORTS_DIR/phpstan-checkstyle.xml"';
}
if (process.env.SCENARIO === 'failure') {
const source = '.test-php-lint/src/Sample.php';
Expand Down Expand Up @@ -61,60 +65,17 @@ jobs:
with:
script: |
const assert = require('node:assert/strict');
const fs = require('node:fs');
assert.equal(process.env.OUTCOME, process.env.SCENARIO === 'failure' ? 'failure' : 'success');
if (process.env.SCENARIO === 'no-reports') {
assert.equal(process.env.ARTIFACT_ID, '');
return;
}
assert.equal(process.env.OUTCOME, ['failure','no-reports'].includes(process.env.SCENARIO) ? 'failure' : 'success');
assert.match(process.env.ARTIFACT_ID, /^\d+$/);
const {createHash} = require('node:crypto');
const report = fs.readFileSync('.test-php-lint/phpstan-checkstyle.xml', 'utf8');
core.setOutput('expected-reports', {'phpstan-checkstyle.xml': createHash('sha256').update(report).digest('hex')});
assert.match(report, /<checkstyle\b/);
assert.equal(report.includes('<error'), process.env.SCENARIO === 'failure');
core.setOutput('expected-reports', process.env.SCENARIO === 'no-reports' ? {} : {'phpstan-checkstyle.xml':null});

verify-reports:
needs: lint
if: needs.lint.outputs.report-artifact-id != ''
uses: $/.github/workflows/__assert-report-artifact.yml
permissions:
actions: read
with:
artifact-id: ${{ needs.lint.outputs.report-artifact-id }}
expected-reports: ${{ needs.lint.outputs.expected-reports }}

individual-comment:
if: inputs.scenario == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Arrange - Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Arrange - Install the Composer fixture
uses: $/actions/setup-php
with:
working-directory: tests/php-project
coverage: none
- name: Arrange - Configure PHPStan report generation
working-directory: tests/php-project
run: composer config scripts.lint:ci 'tools/vendor/bin/phpstan analyse src --level=max --no-progress --error-format=checkstyle > phpstan-checkstyle.xml'
- name: Act - Publish an individual lint report
uses: $/actions/lint
with:
working-directory: tests/php-project
comment: "true"
- name: Assert - One lint comment with collapsed details
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const assert = require('node:assert/strict');
const pr = context.payload.pull_request;
if (context.eventName !== 'pull_request' || pr.head.repo.full_name !== `${context.repo.owner}/${context.repo.repo}`) return;
const comments = await github.paginate(github.rest.issues.listComments, {...context.repo, issue_number: pr.number, per_page: 100});
const reports = comments.filter(comment => comment.user.login === 'github-actions[bot]' && comment.body.startsWith('PHP lint results\n'));
assert.equal(reports.length, 1);
assert.match(reports[0].body, /<details>/);
assert.match(reports[0].body, /0 errors/);
discard-fixture: ${{ inputs.scenario != 'success' }}
2 changes: 1 addition & 1 deletion .github/workflows/__test-action-package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- failing-command
- mutated-archive
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: $/actions/setup-php
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/__test-action-setup-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Arrange - Copy a project without a lockfile
Expand Down
Loading
Loading