From cbc0e97c29b8dcb3d6ff96eb3af9e0f519a22345 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 14 Oct 2026 20:10:17 +0800 Subject: [PATCH] test(ci): bind npm cache IDs to output consumers Remove the blanket caller ID requirement that rejected the standalone mutation workflow. Keep producer bindings where static cache authorization and package verification consume action outputs. --- .../boundary/filesystem/ciCachePolicy.test.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/boundary/filesystem/ciCachePolicy.test.ts b/tests/boundary/filesystem/ciCachePolicy.test.ts index 4dea36ae5c..17bd6c9747 100644 --- a/tests/boundary/filesystem/ciCachePolicy.test.ts +++ b/tests/boundary/filesystem/ciCachePolicy.test.ts @@ -169,7 +169,6 @@ printf '%s\n' 'C:\Users\runner with spaces\AppData\Local\npm-cache' const step = steps[index]; if (step?.uses !== "./.github/actions/npm-cache") continue; npmCacheSteps++; - expect(step.id).toBe("npm-cache"); const setup = steps[index - 1]; expect( typeof setup?.uses === "string" && @@ -198,6 +197,9 @@ it("shares static task snapshots only after validation using the npm cache owner const workflows = await readWorkflows(); const ci = workflows.find(({ file }) => file === "ci.yml"); const steps = ci?.workflow.jobs?.static?.steps ?? []; + expect( + steps.find((step) => step.uses === "./.github/actions/npm-cache")?.id, + ).toBe("npm-cache"); const restore = steps.find((step) => step.id === "static-cache"); const save = steps.find( (step) => step.name === "Save validated static task cache", @@ -221,6 +223,24 @@ it("shares static task snapshots only after validation using the npm cache owner ); }); +it("passes the npm cache owner's selected path to package installation", async () => { + const workflows = await readWorkflows(); + const ci = workflows.find(({ file }) => file === "ci.yml"); + const steps = ci?.workflow.jobs?.["package-e2e"]?.steps ?? []; + const cacheIndex = steps.findIndex( + (step) => step.uses === "./.github/actions/npm-cache", + ); + expect(steps[cacheIndex]?.id).toBe("npm-cache"); + const consumerIndex = steps.findIndex( + (step) => step.run === "npm run verify:package", + ); + expect(consumerIndex).toBeGreaterThan(cacheIndex); + expect( + z.record(z.string(), z.unknown()).parse(steps[consumerIndex]?.env) + .npm_config_cache, + ).toBe("${{ steps.npm-cache.outputs.path }}"); +}); + it("bounds the rolling static snapshot with Turbo age and size eviction", async () => { const turbo = z .object({