From 92d346156be39375d8357872e5c927d12e6d5953 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 28 Oct 2026 07:58:34 +0100 Subject: [PATCH] Use the newest Node release in CI instead of the runner's cached one. --- .github/workflows/test_tutorials.yml | 2 ++ src/app/tests/unit/test_workflows.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/app/tests/unit/test_workflows.py 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")