From 1776005e5bab8d3963761e4b3a41443b7e9df679 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Fri, 4 Dec 2026 19:12:07 -0800 Subject: [PATCH] ci: check block documentation relative links --- .github/block/scripts/block-ci-port-test.py | 11 +++++++++++ .github/workflows/block-test.yml | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/.github/block/scripts/block-ci-port-test.py b/.github/block/scripts/block-ci-port-test.py index 8b5d6e1c5b..ecbd0cf46a 100644 --- a/.github/block/scripts/block-ci-port-test.py +++ b/.github/block/scripts/block-ci-port-test.py @@ -12,6 +12,17 @@ ROOT = HERE.parents[2] class PortTests(unittest.TestCase): + def test_relative_documentation_links_are_checked(self): + text = (ROOT / ".github/workflows/block-test.yml").read_text() + marker = " - name: Relative documentation links\n" + self.assertEqual(text.count(marker), 1) + step = text.split(marker, 1)[1].split("\n - name:", 1)[0] + self.assertIn("if: matrix.suite == 'unit'", step) + self.assertIn("python3 -B .github/scripts/doc-links-check-test.py", step) + self.assertIn("python3 -I .github/scripts/doc-links-check.py .", step) + self.assertNotIn("continue-on-error", step) + self.assertNotIn("|| true", step) + def test_root_workflows_use_module_run_and_action_paths(self): for name in ("test", "spec-trace", "post-merge-review", "known-bugs"): text = (ROOT / (".github/workflows/block-" + name + ".yml")).read_text() diff --git a/.github/workflows/block-test.yml b/.github/workflows/block-test.yml index dd2982a3af..eaa11fca58 100644 --- a/.github/workflows/block-test.yml +++ b/.github/workflows/block-test.yml @@ -69,6 +69,12 @@ jobs: - name: Nested module CI contracts run: python3 -I ../.github/block/scripts/block-ci-port-test.py + - name: Relative documentation links + if: matrix.suite == 'unit' + run: | + python3 -B .github/scripts/doc-links-check-test.py + python3 -I .github/scripts/doc-links-check.py . + - name: Runner disk is NVMe # A self-hosted runner whose work, temp or Go cache directory sits on a # SATA system disk times the process-level tests out under disk load;