Skip to content

Commit e9ca041

Browse files
committed
[reports] Validate published HTML with proof-html
1 parent a1b837f commit e9ca041

4 files changed

Lines changed: 57 additions & 1 deletion

File tree

.github/workflows/reports.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,56 @@ jobs:
194194
/coverage/|Preview coverage report
195195
/metrics/|Preview metrics report
196196
197+
validate_main_reports_html:
198+
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && !(github.event_name == 'workflow_dispatch' && inputs.cleanup-previews)
199+
name: Validate Main Reports HTML
200+
needs: verify_main_reports
201+
runs-on: ubuntu-latest
202+
203+
steps:
204+
- name: Checkout published reports
205+
uses: actions/checkout@v6
206+
with:
207+
ref: gh-pages
208+
path: gh-pages
209+
210+
- name: Exclude pull request previews from main validation
211+
run: rm -rf gh-pages/previews
212+
213+
- name: Validate published main reports HTML
214+
uses: anishathalye/proof-html@v2
215+
with:
216+
directory: ./gh-pages
217+
disable_external: true
218+
check_external_hash: false
219+
220+
validate_preview_reports_html:
221+
if: github.event_name == 'pull_request' && github.event.action != 'closed'
222+
name: Validate Pull Request Reports HTML
223+
needs: verify_preview_reports
224+
runs-on: ubuntu-latest
225+
226+
steps:
227+
- name: Checkout published reports
228+
uses: actions/checkout@v6
229+
with:
230+
ref: gh-pages
231+
path: gh-pages
232+
233+
- name: Validate published preview reports HTML
234+
uses: anishathalye/proof-html@v2
235+
with:
236+
directory: ./gh-pages/previews/pr-${{ github.event.pull_request.number }}
237+
disable_external: true
238+
check_external_hash: false
239+
197240
comment_preview:
198241
if: github.event_name == 'pull_request' && github.event.action != 'closed'
199242
name: Comment Pull Request Preview URLs
200243
needs:
201244
- reports
202245
- verify_preview_reports
246+
- validate_preview_reports_html
203247
runs-on: ubuntu-latest
204248
permissions:
205249
pull-requests: write
@@ -299,6 +343,8 @@ jobs:
299343
- reports
300344
- verify_main_reports
301345
- verify_preview_reports
346+
- validate_main_reports_html
347+
- validate_preview_reports_html
302348
- cleanup_preview
303349
- cleanup_orphaned_previews
304350
runs-on: ubuntu-latest
@@ -325,7 +371,9 @@ jobs:
325371
echo "- PHP version source: \`${{ needs.resolve_php.outputs.php-version-source }}\`"
326372
echo "- Reports job result: \`${{ needs.reports.result }}\`"
327373
echo "- Main verification result: \`${{ needs.verify_main_reports.result }}\`"
374+
echo "- Main HTML validation result: \`${{ needs.validate_main_reports_html.result }}\`"
328375
echo "- Preview verification result: \`${{ needs.verify_preview_reports.result }}\`"
376+
echo "- Preview HTML validation result: \`${{ needs.validate_preview_reports_html.result }}\`"
329377
echo "- Closed-preview cleanup result: \`${{ needs.cleanup_preview.result }}\`"
330378
echo "- Orphan cleanup result: \`${{ needs.cleanup_orphaned_previews.result }}\`"
331379
echo "- Trigger: \`${TRIGGER_LABEL}\`"
@@ -335,13 +383,15 @@ jobs:
335383
echo "- Coverage: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/coverage/"
336384
echo "- Metrics: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/metrics/"
337385
echo "- Deployment verification: \`${{ needs.verify_main_reports.result }}\`"
386+
echo "- HTML validation: \`${{ needs.validate_main_reports_html.result }}\`"
338387
fi
339388
340389
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.action }}" != "closed" ]; then
341390
echo "- Preview docs: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/previews/pr-${{ github.event.pull_request.number }}/"
342391
echo "- Preview coverage: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/previews/pr-${{ github.event.pull_request.number }}/coverage/"
343392
echo "- Preview metrics: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/previews/pr-${{ github.event.pull_request.number }}/metrics/"
344393
echo "- Preview verification: \`${{ needs.verify_preview_reports.result }}\`"
394+
echo "- Preview HTML validation: \`${{ needs.validate_preview_reports_html.result }}\`"
345395
fi
346396
347397
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.action }}" = "closed" ]; then

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Keep required PHPUnit matrix checks reporting after workflow-managed `.github/wiki` pointer commits by running the pull-request test workflow without top-level path filters and aligning the packaged consumer test wrapper (#230)
1313
- Ignore intentional Composer Dependency Analyser shadow dependency findings by default while adding `dependencies --show-shadow-dependencies` for audits (#233)
1414
- Dispatch the required test workflow after wiki preview automation updates a pull-request `.github/wiki` pointer, avoiding permanently pending required checks on bot-authored pointer commits (#230)
15+
- Validate published main and pull-request report HTML with `proof-html` after GitHub Pages deployment health checks pass (#178)
1516

1617
## [1.21.0] - 2026-04-24
1718

docs/advanced/consumer-automation.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ How GitHub Pages Publishing Works
7171
---------------------------------
7272

7373
- ``.github/workflows/reports.yml`` runs ``composer dev-tools reports``.
74-
- The workflow delegates repeated GitHub Pages tasks to
74+
- The workflow verifies published URLs, validates published HTML with
75+
``proof-html``, and delegates repeated GitHub Pages tasks to
7576
``.github/actions/github-pages/*`` instead of keeping that shell logic inline.
7677
- Pull requests publish previews under ``previews/pr-<number>/``.
7778
- On the ``main`` branch, GitHub Pages serves the generated site from the root

docs/usage/github-actions.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ The ``reports.yml`` workflow is responsible for generating technical documentati
7171
**Behavior:**
7272
* **Main Branch**: Runs all checks and deploys the final reports to the root of the ``gh-pages`` branch.
7373
* Runs a post-deploy health check against the published reports index and coverage URLs with retry/backoff to account for Pages propagation.
74+
* Checks out the published ``gh-pages`` content after deployment
75+
verification and runs ``proof-html`` against the main reports site,
76+
excluding historical pull-request previews from that main-site scan.
7477
* Resolves the workflow PHP version from ``composer.lock`` or ``composer.json`` before installing dependencies.
7578
* Removes ``.dev-tools/cache`` from the publish directory before deployment so repository-local tool caches never leak into GitHub Pages output.
7679
* Appends a run summary with the published docs, coverage, and metrics URLs plus deployment verification status.
7780
* **Pull Requests**:
7881
* Generates a **Preview** of the documentation, coverage, and metrics.
7982
* Deploys the preview to ``gh-pages`` under ``previews/pr-{number}/``.
8083
* Verifies the preview index and coverage URLs after deployment before posting preview links.
84+
* Runs ``proof-html`` against the published preview directory before posting preview links.
8185
* Posts a **Sticky Comment** on the PR with links to the live preview, coverage report, and metrics site.
8286
* Appends a run summary with preview URLs and verification status.
8387
* Groups nested command output into collapsible GitHub Actions log sections so docs, tests, and metrics are easier to inspect independently.

0 commit comments

Comments
 (0)