Files
moltbot/test/scripts/website-installer-sync-workflow.test.ts
Peter Steinberger e60928d13c ci: verify and sync website installers (#80067)
* ci: verify and sync website installers

* test: fix pi runner boundary test type cast

* fix(installer): scope Windows legacy cleanup to git checkout

* ci: install curl for minimal install-cli smoke

* fix(installer): promote supported Linux node after install

* test(cli): align command hint expectations

* fix(installer): avoid shellcheck warning in node promotion

* fix(installer): sync Linux path hardening

* ci: raise build artifact testbox heap

* test(installer): align PowerShell installer tests
2026-05-09 23:48:49 -04:00

56 lines
2.5 KiB
TypeScript

import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const { detectInstallSmokeScope } = (await import("../../scripts/ci-changed-scope.mjs")) as {
detectInstallSmokeScope: (paths: string[]) => {
runFastInstallSmoke: boolean;
runFullInstallSmoke: boolean;
};
};
const WORKFLOW_PATH = ".github/workflows/website-installer-sync.yml";
describe("website installer sync workflow", () => {
const workflow = readFileSync(WORKFLOW_PATH, "utf8");
it("treats all website installer scripts as OpenClaw-owned inputs", () => {
for (const path of [
"scripts/install.sh",
"scripts/install-cli.sh",
"scripts/install.ps1",
"scripts/install.cmd",
]) {
expect(workflow).toContain(path);
expect(detectInstallSmokeScope([path]).runFullInstallSmoke).toBe(true);
}
});
it("verifies installers on Linux Docker plus native macOS and Windows runners", () => {
expect(workflow).toContain("linux-docker:");
expect(workflow).toContain("docker run --rm");
expect(workflow).toContain("bash /tmp/install.sh --no-prompt --no-onboard");
expect(workflow).toContain("bash /tmp/install-cli.sh --prefix /tmp/openclaw");
expect(workflow).toContain("macos-installer:");
expect(workflow).toContain("runs-on: macos-latest");
expect(workflow).toContain("windows-installer:");
expect(workflow).toContain("runs-on: windows-latest");
expect(workflow).toContain(".\\scripts\\install.ps1 -DryRun");
expect(workflow).toContain("OPENCLAW_INSTALL_PS1_URL=%GITHUB_WORKSPACE%\\scripts\\install.ps1");
expect(workflow).toContain(".\\scripts\\install.cmd --dry-run");
});
it("syncs verified scripts to openclaw.ai only after all installer checks pass", () => {
expect(workflow).toContain("needs: [static, linux-docker, macos-installer, windows-installer]");
expect(workflow).toContain("repository: openclaw/openclaw.ai");
expect(workflow).toContain("token: ${{ secrets.OPENCLAW_GH_TOKEN }}");
expect(workflow).toContain("cp openclaw/scripts/install.sh openclaw.ai/public/install.sh");
expect(workflow).toContain(
"cp openclaw/scripts/install-cli.sh openclaw.ai/public/install-cli.sh",
);
expect(workflow).toContain("cp openclaw/scripts/install.ps1 openclaw.ai/public/install.ps1");
expect(workflow).toContain("cp openclaw/scripts/install.cmd openclaw.ai/public/install.cmd");
expect(workflow).toContain("bun run build");
expect(workflow).toContain("git push origin HEAD:main");
});
});