mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-12 19:50:57 +05:00
Run docs snippets only on macOS and Ubuntu in CI
This commit is contained in:
parent
ddad35b85b
commit
0bdb6f116c
@ -34,6 +34,7 @@ ENVIRONMENT_RUNNERS = {
|
||||
"freebsd": "ubuntu-24.04",
|
||||
"openbsd": "ubuntu-24.04",
|
||||
}
|
||||
CI_ENVIRONMENTS = {"ubuntu", "macos"}
|
||||
SCENARIOS = {"project", "collection", "system", "system-data", "docker", "docker-data"}
|
||||
FENCE_START = re.compile(r"^(?P<indent>[ \t]*)(?P<fence>`{3,}|~{3,})[ \t]*(?P<info>[^\n]*)$")
|
||||
HTML_PRE = re.compile(
|
||||
@ -274,6 +275,7 @@ def matrix() -> dict[str, list[dict[str, str]]]:
|
||||
snippets = validate_all()
|
||||
records = load_manifest()
|
||||
environments = {records[snippet.id]["environment"] for snippet in snippets if records[snippet.id]["disposition"] == "run"}
|
||||
ci_environments = environments.intersection(CI_ENVIRONMENTS)
|
||||
include = [
|
||||
{
|
||||
"name": environment,
|
||||
@ -281,12 +283,14 @@ def matrix() -> dict[str, list[dict[str, str]]]:
|
||||
"runner": ENVIRONMENT_RUNNERS[environment],
|
||||
}
|
||||
for environment in ENVIRONMENT_RUNNERS
|
||||
if environment in environments
|
||||
if environment in ci_environments
|
||||
]
|
||||
assigned_ids = [snippet.id for snippet in snippets if records[snippet.id]["disposition"] == "run"]
|
||||
assert include, "At least one deterministic documentation example must run in CI"
|
||||
assert len(set(assigned_ids)) == len(assigned_ids)
|
||||
assert {entry["environment"] for entry in include} == environments, "Every runnable snippet environment must have exactly one CI lane"
|
||||
assert {entry["environment"] for entry in include} == ci_environments, (
|
||||
"Every selected CI documentation environment must have exactly one lane"
|
||||
)
|
||||
return {"include": include}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user