mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
ci: pin docs i18n Go toolchain (#103244)
This commit is contained in:
committed by
GitHub
parent
25eaa53a8a
commit
73db6b2aca
@@ -1170,6 +1170,10 @@ jobs:
|
||||
go-version-file: scripts/docs-i18n/go.mod
|
||||
cache-dependency-path: scripts/docs-i18n/go.sum
|
||||
|
||||
- name: Verify docs i18n Go toolchain
|
||||
if: matrix.requires_go == true
|
||||
run: test "$(go env GOVERSION)" = "go1.25.12"
|
||||
|
||||
- name: Configure Node test resources
|
||||
run: echo "OPENCLAW_VITEST_MAX_WORKERS=2" >> "$GITHUB_ENV"
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ module github.com/openclaw/openclaw/scripts/docs-i18n
|
||||
|
||||
go 1.25.0
|
||||
|
||||
toolchain go1.25.12
|
||||
|
||||
require (
|
||||
github.com/yuin/goldmark v1.8.2
|
||||
golang.org/x/net v0.55.0
|
||||
|
||||
@@ -3267,7 +3267,11 @@ function resolveDocsI18nGoTargets(changedPath) {
|
||||
if (!/^scripts\/docs-i18n\/(?:go\.(?:mod|sum)|[^/]+\.go)$/u.test(changedPath)) {
|
||||
return null;
|
||||
}
|
||||
return ["test/scripts/docs-i18n.test.ts"];
|
||||
const targets = ["test/scripts/docs-i18n.test.ts"];
|
||||
if (changedPath === "scripts/docs-i18n/go.mod") {
|
||||
targets.push("test/scripts/ci-workflow-guards.test.ts");
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
|
||||
function resolveK8sManifestTargets(changedPath) {
|
||||
|
||||
@@ -799,19 +799,13 @@ describe("ci workflow guards", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("fails and retries quiet Node test shard stalls quickly", () => {
|
||||
it("keeps docs i18n CI on the patched preferred Go toolchain", () => {
|
||||
const workflow = readCiWorkflow();
|
||||
const preflightJob = workflow.jobs.preflight;
|
||||
const manifestStep = preflightJob.steps.find((step) => step.name === "Build CI manifest");
|
||||
const nodeTestJob = workflow.jobs["checks-node-core-test-nondist-shard"];
|
||||
const setupGoStep = nodeTestJob.steps.find((step) => step.name === "Setup Go for docs i18n");
|
||||
const runStep = nodeTestJob.steps.find((step) => step.name === "Run Node test shard");
|
||||
|
||||
expect(JSON.stringify(preflightJob.steps)).toContain("timeout_minutes: shard.timeoutMinutes");
|
||||
expect(manifestStep.run).toContain(
|
||||
'shard.groups?.some((group) => group.shard_name === "core-tooling")',
|
||||
const verifyGoStep = nodeTestJob.steps.find(
|
||||
(step) => step.name === "Verify docs i18n Go toolchain",
|
||||
);
|
||||
expect(nodeTestJob["timeout-minutes"]).toBe("${{ matrix.timeout_minutes || 60 }}");
|
||||
expect(setupGoStep).toMatchObject({
|
||||
if: "matrix.requires_go == true",
|
||||
uses: SETUP_GO_V6,
|
||||
@@ -820,6 +814,29 @@ describe("ci workflow guards", () => {
|
||||
"cache-dependency-path": "scripts/docs-i18n/go.sum",
|
||||
},
|
||||
});
|
||||
expect(setupGoStep.with).not.toHaveProperty("go-version");
|
||||
expect(verifyGoStep).toMatchObject({
|
||||
if: "matrix.requires_go == true",
|
||||
run: 'test "$(go env GOVERSION)" = "go1.25.12"',
|
||||
});
|
||||
|
||||
const goMod = readTrackedText("scripts/docs-i18n/go.mod");
|
||||
expect(goMod).toMatch(/^go 1\.25\.0$/mu);
|
||||
expect(goMod).toMatch(/^toolchain go1\.25\.12$/mu);
|
||||
});
|
||||
|
||||
it("fails and retries quiet Node test shard stalls quickly", () => {
|
||||
const workflow = readCiWorkflow();
|
||||
const preflightJob = workflow.jobs.preflight;
|
||||
const manifestStep = preflightJob.steps.find((step) => step.name === "Build CI manifest");
|
||||
const nodeTestJob = workflow.jobs["checks-node-core-test-nondist-shard"];
|
||||
const runStep = nodeTestJob.steps.find((step) => step.name === "Run Node test shard");
|
||||
|
||||
expect(JSON.stringify(preflightJob.steps)).toContain("timeout_minutes: shard.timeoutMinutes");
|
||||
expect(manifestStep.run).toContain(
|
||||
'shard.groups?.some((group) => group.shard_name === "core-tooling")',
|
||||
);
|
||||
expect(nodeTestJob["timeout-minutes"]).toBe("${{ matrix.timeout_minutes || 60 }}");
|
||||
expect(runStep.env.OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS).toBe("300000");
|
||||
expect(runStep.env.OPENCLAW_VITEST_NO_OUTPUT_RETRY).toBe("1");
|
||||
expect(runStep.env.OPENCLAW_TEST_PROJECTS_PARALLEL).toBe("2");
|
||||
|
||||
@@ -1188,15 +1188,19 @@ describe("scripts/test-projects changed-target routing", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps docs i18n Go module edits on Go module tests", () => {
|
||||
for (const modulePath of [
|
||||
"scripts/docs-i18n/main.go",
|
||||
"scripts/docs-i18n/main_test.go",
|
||||
"scripts/docs-i18n/go.mod",
|
||||
]) {
|
||||
it("keeps docs i18n Go edits on their module and workflow guards", () => {
|
||||
const cases = [
|
||||
["scripts/docs-i18n/main.go", ["test/scripts/docs-i18n.test.ts"]],
|
||||
["scripts/docs-i18n/main_test.go", ["test/scripts/docs-i18n.test.ts"]],
|
||||
[
|
||||
"scripts/docs-i18n/go.mod",
|
||||
["test/scripts/docs-i18n.test.ts", "test/scripts/ci-workflow-guards.test.ts"],
|
||||
],
|
||||
] as const;
|
||||
for (const [modulePath, targets] of cases) {
|
||||
expect(resolveChangedTestTargetPlan([modulePath]), modulePath).toEqual({
|
||||
mode: "targets",
|
||||
targets: ["test/scripts/docs-i18n.test.ts"],
|
||||
targets,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user