diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 165b3e672..0383856fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,13 +64,16 @@ validation above is its check. For code, profiles or platform files, these are the checks CI runs on a pull request (Python 3.12 or newer): ```bash -pip install pyyaml "jsonschema[format-nongpl]" markdown +pip install pyyaml "jsonschema[format-nongpl]" markdown pyte hypothesis vermin python scripts/validate_pr.py --changed # the BIOS files the branch adds python scripts/validate_schemas.py --source-only # profiles and platform files python scripts/profile_sync.py --added --base upstream/main --strict # each profile the branch adds python scripts/refresh_data_dirs.py # data directories the pack-building tests read python scripts/generate_site.py # the pages the site tests read +npm ci --prefix website && npm run build --prefix website # the built site, Node 24 python -m unittest discover -s tests -t . +python scripts/validate_site.py --site-dir website/dist # links and page budgets +vermin --no-tips -t=3.8- --violations install.py # install.py stays on Python 3.8 ``` `upstream` is this repository as a remote of your fork diff --git a/scripts/generate_readme.py b/scripts/generate_readme.py index fb6bfa462..596f62d68 100644 --- a/scripts/generate_readme.py +++ b/scripts/generate_readme.py @@ -969,13 +969,16 @@ validation above is its check. For code, profiles or platform files, these are the checks CI runs on a pull request (Python 3.12 or newer): ```bash -pip install pyyaml "jsonschema[format-nongpl]" markdown +pip install pyyaml "jsonschema[format-nongpl]" markdown pyte hypothesis vermin python scripts/validate_pr.py --changed # the BIOS files the branch adds python scripts/validate_schemas.py --source-only # profiles and platform files python scripts/profile_sync.py --added --base upstream/main --strict # each profile the branch adds python scripts/refresh_data_dirs.py # data directories the pack-building tests read python scripts/generate_site.py # the pages the site tests read +npm ci --prefix website && npm run build --prefix website # the built site, Node 24 python -m unittest discover -s tests -t . +python scripts/validate_site.py --site-dir website/dist # links and page budgets +vermin --no-tips -t=3.8- --violations install.py # install.py stays on Python 3.8 ``` `upstream` is this repository as a remote of your fork diff --git a/tests/test_contributing_text.py b/tests/test_contributing_text.py index 09392caea..bf00749aa 100644 --- a/tests/test_contributing_text.py +++ b/tests/test_contributing_text.py @@ -78,6 +78,25 @@ class BeforeOpeningAPullRequest(unittest.TestCase): self.assertIn("profile_sync.py --added --base upstream/main --strict", block) self.assertNotIn("--changed --strict", block) + def test_it_names_the_site_build_and_the_packages_ci_runs(self): + """A wiki-only change passed every listed check and failed CI on + validate_site.py, which the list did not name.""" + text = generate_readme.generate_contributing() + section = text.split("## Before opening a PR", 1)[1].split("\n## ", 1)[0] + workflow = (REPO_ROOT / ".github" / "workflows" / "validate.yml").read_text(encoding="utf-8") + for command in ("npm ci --prefix website", "npm run build --prefix website", + "validate_site.py --site-dir website/dist", + "vermin --no-tips -t=3.8- --violations install.py"): + with self.subTest(command=command): + self.assertIn(command, workflow) + self.assertIn(command, section) + installed = re.search(r'^\s*run: pip install (pyyaml "jsonschema.*markdown.*)$', + workflow, re.M).group(1) + pip_line = next(line for line in section.splitlines() if line.startswith("pip install")) + for package in (re.split(r"[\[=]", token.strip('"'))[0] for token in installed.split()): + with self.subTest(package=package): + self.assertRegex(pip_line, rf"\b{package}\b") + def test_it_installs_what_the_checks_need_and_no_site_package(self): """The site is built by Node from website/package-lock.json: a pip line naming the old theme installed packages nothing reads."""