diff --git a/.github/workflows/test_tutorials.yml b/.github/workflows/test_tutorials.yml index c111d2d..8c1cd8d 100644 --- a/.github/workflows/test_tutorials.yml +++ b/.github/workflows/test_tutorials.yml @@ -37,6 +37,8 @@ jobs: uses: actions/setup-node@v7 with: node-version: 22 + # The newest release, not the runner's cached one: Astro raises its minimum often. + check-latest: true cache: npm cache-dependency-path: docs/package-lock.json diff --git a/src/app/tests/unit/test_workflows.py b/src/app/tests/unit/test_workflows.py new file mode 100644 index 0000000..7470f7e --- /dev/null +++ b/src/app/tests/unit/test_workflows.py @@ -0,0 +1,14 @@ +"""The CI workflows: Node comes from the newest release, not the runner's tool cache.""" + +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[4] +WORKFLOWS = sorted((ROOT / ".github" / "workflows").glob("*.yml")) + + +@pytest.mark.parametrize("workflow", WORKFLOWS, ids=lambda path: path.name) +def test_setup_node_checks_latest(workflow): + text = workflow.read_text() + assert text.count("actions/setup-node") == text.count("check-latest: true")