fix: preserve frozen source bytes in CI
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 53s
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 53s
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
# Frozen inputs must retain their committed bytes on every platform.
|
||||||
|
/PRD.md -text
|
||||||
|
/FeatureSummary.md -text
|
||||||
|
/DevelopmentPlan.md -text
|
||||||
|
/UIDesign.md -text
|
||||||
|
/tdd.md -text
|
||||||
|
/Dada-P0A-LowFi.pen -text
|
||||||
|
/tasks.md -text
|
||||||
|
/tasks.manifest.json -text
|
||||||
|
/Dada-LowFi-Preview/** -text
|
||||||
@@ -2,7 +2,16 @@ import assert from "node:assert/strict";
|
|||||||
import { readFileSync } from "node:fs";
|
import { readFileSync } from "node:fs";
|
||||||
|
|
||||||
const policy = JSON.parse(readFileSync("ci/runner-isolation-policy.json", "utf8"));
|
const policy = JSON.parse(readFileSync("ci/runner-isolation-policy.json", "utf8"));
|
||||||
|
const manifest = JSON.parse(readFileSync("tasks.manifest.json", "utf8"));
|
||||||
const workflow = readFileSync(".gitea/workflows/p0a-ci.yml", "utf8");
|
const workflow = readFileSync(".gitea/workflows/p0a-ci.yml", "utf8");
|
||||||
|
const gitAttributes = readFileSync(".gitattributes", "utf8");
|
||||||
|
|
||||||
|
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
|
const frozenBytePaths = [...Object.keys(manifest.source_hashes), "tasks.manifest.json"];
|
||||||
|
for (const path of frozenBytePaths) {
|
||||||
|
assert.match(gitAttributes, new RegExp(`^/${escapeRegExp(path)}\\s+-text\\s*$`, "m"));
|
||||||
|
}
|
||||||
|
assert.match(gitAttributes, /^\/Dada-LowFi-Preview\/\*\*\s+-text\s*$/m);
|
||||||
|
|
||||||
for (const label of policy.required_labels) assert.match(workflow, new RegExp(`\\b${label}\\b`));
|
for (const label of policy.required_labels) assert.match(workflow, new RegExp(`\\b${label}\\b`));
|
||||||
assert.doesNotMatch(workflow, /\bcorepack enable\b/);
|
assert.doesNotMatch(workflow, /\bcorepack enable\b/);
|
||||||
|
|||||||
Reference in New Issue
Block a user