fix: build the site before the CI test suite

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:45:49 +01:00
1 parent ecb56c43e5
commit 0b8e4b4767
2 files changed
+14 -4

No files matched your search

+9 -4
View File
@@ -283,6 +283,13 @@ jobs:
if: ${{ !cancelled() }}
run: python scripts/generate_site.py
# website/dist is gitignored too. Built after the suite, the tests that
# read the rendered pages (page budgets, sidebar, search) found none and
# skipped on every run.
- name: Build the site
if: ${{ !cancelled() }}
run: npm run build --prefix website
- name: Run test suite
if: ${{ !cancelled() }}
# No test downloads a release asset: 252 MB files fetched into the
@@ -302,11 +309,9 @@ jobs:
# heading failed it there with nothing in front of it. Run whatever the
# suite returned, so one red step does not hide the other. The release
# assets are not restored: they change counts, not links or headings.
- name: Build the site
- name: Check the built site
if: ${{ !cancelled() }}
run: |
npm run build --prefix website
python scripts/validate_site.py --site-dir website/dist
run: python scripts/validate_site.py --site-dir website/dist
label-pr:
runs-on: ubuntu-latest
+5
View File
@@ -142,6 +142,11 @@ class ThePullRequestBuildsTheSite(unittest.TestCase):
)
suite = next(i for i, run in enumerate(runs) if "unittest discover" in run)
self.assertLess(generate, suite)
# The built pages too: about fifty tests read website/dist.
build = next(i for i, run in enumerate(runs) if "npm run build" in run)
self.assertLess(generate, build)
self.assertLess(build, suite)
self.assertEqual(steps[build].get("if"), "${{ !cancelled() }}")
self.assertEqual(steps[suite].get("if"), "${{ !cancelled() }}")
# A failed data fetch skipped the generator, and all 228 site tests
# then failed under it: the generator runs whatever came before.