ci: update Actions to supported Node 24 runtimes

This commit is contained in:
amosblomqvist
2026-10-16 22:51:42 +03:00
parent a0a5018a42
commit 15772f47c9
3 changed files with 44 additions and 12 deletions
+4 -4
View File
@@ -22,8 +22,8 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 20 timeout-minutes: 20
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: actions/setup-node@v4 - uses: actions/setup-node@v7
with: with:
node-version: "26" node-version: "26"
cache: npm cache: npm
@@ -51,8 +51,8 @@ jobs:
run: run:
shell: bash shell: bash
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: actions/setup-node@v4 - uses: actions/setup-node@v7
with: with:
node-version: "26" node-version: "26"
cache: npm cache: npm
+8 -8
View File
@@ -24,8 +24,8 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 20 timeout-minutes: 20
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: actions/setup-node@v4 - uses: actions/setup-node@v7
with: with:
node-version: "26" node-version: "26"
cache: npm cache: npm
@@ -57,7 +57,7 @@ jobs:
# Preparing once avoids the publisher's list-miss/create race between OS jobs. # Preparing once avoids the publisher's list-miss/create race between OS jobs.
- name: Create or reuse the tag's draft - name: Create or reuse the tag's draft
if: github.event_name == 'push' if: github.event_name == 'push'
uses: actions/github-script@v7 uses: actions/github-script@v9
with: with:
script: | script: |
const {owner, repo} = context.repo; const {owner, repo} = context.repo;
@@ -108,8 +108,8 @@ jobs:
run: run:
shell: bash shell: bash
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: actions/setup-node@v4 - uses: actions/setup-node@v7
with: with:
node-version: "26" node-version: "26"
cache: npm cache: npm
@@ -170,7 +170,7 @@ jobs:
if: github.event_name == 'workflow_dispatch' && runner.os != 'macOS' if: github.event_name == 'workflow_dispatch' && runner.os != 'macOS'
run: npx electron-builder ${{ matrix.builder_args }} --publish never run: npx electron-builder ${{ matrix.builder_args }} --publish never
- name: Save installers and update metadata - name: Save installers and update metadata
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v7
with: with:
name: learnharness-${{ matrix.platform }} name: learnharness-${{ matrix.platform }}
retention-days: 7 retention-days: 7
@@ -203,10 +203,10 @@ jobs:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
steps: steps:
# The tagged revision — verify exactly what was packaged, not a moving default. # The tagged revision — verify exactly what was packaged, not a moving default.
- uses: actions/checkout@v4 - uses: actions/checkout@v7
with: with:
ref: ${{ github.sha }} ref: ${{ github.sha }}
- uses: actions/setup-node@v4 - uses: actions/setup-node@v7
with: with:
node-version: "26" node-version: "26"
cache: npm cache: npm
+32
View File
@@ -114,6 +114,38 @@ describe("desktop packaging policy", () => {
}); });
}); });
describe("workflow action versions", () => {
type Step = { uses?: string; with?: Record<string, unknown> };
type Workflow = { jobs: Record<string, { steps: Step[] }> };
const yaml = require("js-yaml") as { load(source: string): Workflow };
for (const filename of ["ci.yml", "release.yml"]) {
it(`${filename} uses supported Action runtimes without changing the app's Node 26`, () => {
const workflow = yaml.load(readFileSync(new URL(`../.github/workflows/${filename}`, import.meta.url), "utf8"));
const expected = ["actions/checkout@v7", "actions/setup-node@v7"];
if (filename === "release.yml") {
expected.push("actions/github-script@v9", "actions/upload-artifact@v7", "maxim-lobanov/setup-xcode@v1");
}
const observed = new Set<string>();
for (const job of Object.values(workflow.jobs)) {
for (const step of job.steps) {
if (!step.uses) continue;
assert.ok(expected.includes(step.uses), `unexpected Action reference: ${step.uses}`);
observed.add(step.uses);
if (step.uses === "actions/setup-node@v7") {
assert.equal(step.with?.["node-version"], "26");
assert.equal(step.with?.cache, "npm");
}
if (step.uses === "actions/upload-artifact@v7") {
assert.equal(step.with?.archive ?? true, true, "multi-file installers remain zipped artifacts");
}
}
}
assert.deepEqual([...observed].sort(), expected.sort());
});
}
});
describe("desktop release workflow", () => { describe("desktop release workflow", () => {
type Step = { type Step = {
if?: string; run?: string; uses?: string; env?: Record<string, string>; if?: string; run?: string; uses?: string; env?: Record<string, string>;