fix(ci): close static-check cache gaps and prune stale settings (#14017)

* fix(ci): close static-check cache gaps and prune stale settings

* chore(ci): remove unused Actionlint runner label
This commit is contained in:
morluto
2026-11-23 01:11:58 -05:00
committed by GitHub
parent 4fdacbf982
commit 5817ebb288
8 changed files with 76 additions and 33 deletions
-2
View File
@@ -2,5 +2,3 @@ self-hosted-runner:
labels:
- hopper
- ghidra-12-1-2
# Hosted label introduced after the pinned actionlint release.
- macos-15-intel
-4
View File
@@ -4,11 +4,7 @@
"ignore": [
"node_modules/**",
"dist/**",
"docs/**",
".codex/**",
".devin/**",
"tests/fixtures/**",
"third_party/**",
"tests/conformance/**/*.c",
"tests/conformance/**/*.m",
"tests/conformance/**/*.swift",
-6
View File
@@ -221,12 +221,6 @@
{
"files": ["tests/**/*.test.ts", "src/**/*.test.ts"],
"rules": {
"vitest/valid-expect": [
"warn",
{
"maxArgs": 2
}
],
"vitest/valid-expect-in-promise": "error",
"vitest/no-focused-tests": "error"
}
-2
View File
@@ -109,7 +109,6 @@ const PATH_SCOPES = {
"tests/boundary/providers/GdbSession*.test.ts",
"tests/boundary/providers/GdbCommandQueue.test.ts",
"tests/boundary/providers/gdbTestHelpers.ts",
"tests/boundary/providers/RizinDebugSessionCoverage.part*.test.ts",
"tests/boundary/providers/RizinDebugSession*.test.ts",
"tests/boundary/providers/RizinInferiorTty.test.ts",
"tests/boundary/providers/RizinDecoderInputs.test.ts",
@@ -120,7 +119,6 @@ const PATH_SCOPES = {
"tests/boundary/cli/reverseEngineeringCommands.test.ts",
"tests/boundary/mcp/cutter*.test.ts",
"tests/boundary/mcp/gdb*.test.ts",
"tests/boundary/mcp/debuggerCancellationMcp.test.ts",
"tests/boundary/mcp/rizinDebuggerCancellationMcp.test.ts",
"tests/boundary/mcp/rizinPendingOutput.test.ts",
"tests/boundary/mcp/reverseEngineeringPartialMcp.test.ts",
+1 -1
View File
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { realpath } from "node:fs/promises";
import { isAbsolute } from "node:path";
import { isPathWithinRoot } from "../../../dist/domain/localPath.js";
import { isPathWithinRoot } from "#dist/domain/localPath.js";
/**
* @param {readonly {role?: string, tool_call_id?: string, content?: unknown}[]} messages
@@ -1,4 +1,5 @@
import {
access,
chmod,
cp,
mkdir,
@@ -711,14 +712,20 @@ it.each([
},
);
const reverseToolsVitestConfig = await readFile(
new URL("../../../vitest.reverse-tools.config.ts", import.meta.url),
"utf8",
);
const reverseToolsVitestInputs = [
...reverseToolsVitestConfig.matchAll(/"((?:\.\/)?(?:src|tests)\/[^"]+)"/gu),
].flatMap((match) =>
match[1] === undefined ? [] : [match[1].replace(/^\.\//u, "")],
const reverseToolsVitestInputs = (
await Promise.all(
[
"vitest.reverse-tools.config.ts",
"vitest.reverse-tools-semantics.config.ts",
].map((name) =>
readFile(new URL(`../../../${name}`, import.meta.url), "utf8"),
),
)
).flatMap((source) =>
Array.from(
source.matchAll(/"((?:\.\/)?(?:src|tests)\/[^"]+)"/gu),
([, path]) => path!.replace(/^\.\//u, ""),
),
);
const reverseToolsMutationConfig = JSON.parse(
await readFile(
@@ -736,8 +743,9 @@ const reverseToolsInputs = [
];
it.each(reverseToolsInputs)(
"selects the reverse-tool quality gate for configured input %s",
"keeps configured reverse-tool input %s on disk and in the quality gate",
async (path) => {
await access(new URL(`../../../${path}`, import.meta.url));
expect(await classifyPaths([path])).toMatchObject({
code: true,
reverse_tools: true,
@@ -379,6 +379,20 @@ it.each([
diagnostic: "TS2322",
invalidatesCompile: false,
},
{
label: "imported TypeScript script",
path: "scripts/helper.mts",
content: "export const scriptHelper = 2;\n",
diagnostic: "TS2322",
invalidatesCompile: false,
},
{
label: "imported JavaScript test helper",
path: "tests/helper.mjs",
content: "export const testHelper = 2;\n",
diagnostic: "TS2322",
invalidatesCompile: false,
},
{
label: "GitHub action source",
path: ".github/actions/helper.ts",
@@ -467,6 +481,18 @@ it.each([
join(root, "scripts/api.d.mts"),
'import type { Scope } from "#compiler-scope";\nexport type ApiScope = Scope;\n',
);
await writeFile(
join(root, "scripts/helper.mts"),
"export const scriptHelper = 1;\n",
);
await writeFile(
join(root, "tests/helper.mjs"),
"export const testHelper = 1;\n",
);
await writeFile(
join(root, "tests/use-helpers.ts"),
'import { scriptHelper } from "../scripts/helper.mjs";\nimport { testHelper } from "./helper.mjs";\nexport const checkedScript: 1 = scriptHelper;\nexport const checkedTest: 1 = testHelper;\n',
);
await writeFile(
join(root, "tests/use-script.ts"),
'import type { ApiScope } from "../scripts/api.mjs";\nimport type { TestValue } from "./types.cjs";\nimport type { ScriptValue } from "../scripts/value.cjs";\nexport const scope: ApiScope = "root";\nexport const testValue: TestValue = "root";\nexport const scriptValue: ScriptValue = "root";\n',
@@ -560,13 +586,21 @@ it("invalidates checker task hashes for Node, ignore, and VitePress config chang
await writeFile(join(root, ".npmrc"), "engine-strict=true\n");
await writeFile(join(root, ".gitignore"), ".cache/\n");
await writeFile(join(root, ".jscpd.json"), "{}\n");
await writeFile(join(root, "docs/.vitepress/config.ts"), "export {};\n");
const vitePressEntry = 'export { value } from "./documentation.js";\n';
const ownedHelpers = ["docs/.vitepress/documentation.ts", "tests/helper.mjs"];
const initialHelper = "export const value = 1;\n";
await writeFile(join(root, "docs/.vitepress/config.ts"), vitePressEntry);
for (const helper of ownedHelpers)
await writeFile(join(root, helper), initialHelper);
await writeFile(
join(root, "vitest.config.ts"),
'import { CiTestSequencer } from "./tests/ciTestSequencer.js";\nexport const sequencer = CiTestSequencer;\n',
);
await writeFile(join(root, "src/input.ts"), "export {};\n");
await writeFile(join(root, "tests/input.ts"), "export {};\n");
await writeFile(
join(root, "tests/input.ts"),
'export { value } from "./helper.mjs";\n',
);
const initial = new Map<string, string>();
for (const task of ["jscpd", "knip", "metadata:check", "scan:todos"])
@@ -612,7 +646,19 @@ it("invalidates checker task hashes for Node, ignore, and VitePress config chang
taskHash(root, "knip", cache),
"knip must hash its configured VitePress entry",
).not.toBe(initial.get("knip"));
await writeFile(join(root, "docs/.vitepress/config.ts"), "export {};\n");
await writeFile(join(root, "docs/.vitepress/config.ts"), vitePressEntry);
for (const helper of ownedHelpers) {
await writeFile(join(root, helper), "export const value = 2;\n");
expect(taskHash(root, "knip", cache), helper).not.toBe(initial.get("knip"));
await writeFile(join(root, helper), initialHelper);
}
await mkdir(join(root, "docs/.vitepress/dist"), { recursive: true });
await writeFile(
join(root, "docs/.vitepress/dist/bundle.js"),
"export const value = 1;\n",
);
expect(taskHash(root, "knip", cache)).toBe(initial.get("knip"));
await writeFile(join(root, "vitest.config.ts"), "export {};\n");
expect(
+9 -6
View File
@@ -42,14 +42,13 @@
"scripts/run-typescript.mjs",
"src/**/*.{cts,mts,ts,tsx}",
"src/**/package.json",
"tests/**/*.{cts,mts,ts,tsx}",
"tests/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
"tests/**/package.json",
"tsconfig.json",
"tsconfig.build.json",
"tsconfig.scripts.json",
"vitest*.config.ts",
"scripts/**/*.d.{cts,mts,ts}",
"scripts/**/*.mjs",
"scripts/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
"scripts/**/package.json",
".github/actions/**/*.{cts,mts,ts,tsx}",
".github/**/package.json",
@@ -109,15 +108,19 @@
"package.json",
"package-lock.json",
"scripts/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
"src/**/*.ts",
"tests/**/*.ts",
"src/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
"tests/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
"{src,tests,scripts}/**/package.json",
".github/actions/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
".github/**/package.json",
".github/workflows/*.{yml,yaml}",
".github/**/action.{yml,yaml}",
"tsconfig.json",
"tsconfig.build.json",
"docs/.vitepress/config.ts",
"docs/.vitepress/**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",
"docs/.vitepress/**/package.json",
"!docs/.vitepress/cache/**",
"!docs/.vitepress/dist/**",
"*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}"
]
},