diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c9a5bbd..bf8faa12 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,11 +41,20 @@ Full walkthrough: [profiling guide](https://abdess.github.io/retrobios/wiki/prof ## Before opening a PR +The checks CI runs on a pull request (Python 3.12 or newer): + ```bash +pip install pyyaml "jsonschema[format-nongpl]" +python scripts/validate_pr.py --changed # the BIOS files the branch adds +python scripts/validate_schemas.py --source-only # profiles and platform files python -m unittest discover -s tests -t . -python scripts/pipeline.py --offline ``` +The full pipeline is not needed for a contribution: it rebuilds every pack +(about 35 GB in `dist/`) and needs the data directories fetched first +(`python scripts/refresh_data_dirs.py`), which is why maintainers run it +before a release. + ## PR validation CI computes SHA1/MD5/CRC32 for every new file, checks them against the platform diff --git a/scripts/generate_readme.py b/scripts/generate_readme.py index 1944866c..c7f1bc91 100644 --- a/scripts/generate_readme.py +++ b/scripts/generate_readme.py @@ -721,11 +721,20 @@ Full walkthrough: [profiling guide]({link("wiki/profiling")}). ## Before opening a PR +The checks CI runs on a pull request (Python 3.12 or newer): + ```bash +pip install pyyaml "jsonschema[format-nongpl]" +python scripts/validate_pr.py --changed # the BIOS files the branch adds +python scripts/validate_schemas.py --source-only # profiles and platform files python -m unittest discover -s tests -t . -python scripts/pipeline.py --offline ``` +The full pipeline is not needed for a contribution: it rebuilds every pack +(about 35 GB in `dist/`) and needs the data directories fetched first +(`python scripts/refresh_data_dirs.py`), which is why maintainers run it +before a release. + ## PR validation CI computes SHA1/MD5/CRC32 for every new file, checks them against the platform diff --git a/tests/test_contributing_text.py b/tests/test_contributing_text.py index e4b80660..dda3c7a0 100644 --- a/tests/test_contributing_text.py +++ b/tests/test_contributing_text.py @@ -51,5 +51,25 @@ class CoverageReadsTheGivenProfiles(unittest.TestCase): ) self.assertEqual(seen, ["elsewhere"]) + +class BeforeOpeningAPullRequest(unittest.TestCase): + """The section asked for the full pipeline: on a fresh fork, without + data/, it rebuilt 35 GB of packs and then failed on the data + directories, while CI asks for three checks.""" + + def test_it_lists_the_checks_ci_runs_and_not_the_pipeline(self): + import re as _re + + text = (REPO_ROOT / "CONTRIBUTING.md").read_text(encoding="utf-8") + section = text.split("## Before opening a PR", 1)[1].split("\n## ", 1)[0] + block = _re.search(r"```bash\n(.*?)```", section, _re.S).group(1) + for command in ("validate_pr.py --changed", "validate_schemas.py --source-only", + "unittest discover"): + self.assertIn(command, block) + self.assertNotIn("pipeline.py", block) + workflow = (REPO_ROOT / ".github" / "workflows" / "validate.yml").read_text(encoding="utf-8") + self.assertIn("validate_schemas.py --source-only", workflow) + + if __name__ == "__main__": unittest.main()