mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
fix(ci): keep Docker patch smoke on pnpm workspace config
This commit is contained in:
22
.github/workflows/install-smoke.yml
vendored
22
.github/workflows/install-smoke.yml
vendored
@@ -137,8 +137,9 @@ jobs:
|
||||
node -e "
|
||||
const fs = require(\"node:fs\");
|
||||
const path = require(\"node:path\");
|
||||
const pkg = require(\"/app/package.json\");
|
||||
for (const [dep, rel] of Object.entries(pkg.pnpm?.patchedDependencies ?? {})) {
|
||||
const YAML = require(\"yaml\");
|
||||
const workspace = YAML.parse(fs.readFileSync(\"/app/pnpm-workspace.yaml\", \"utf8\")) ?? {};
|
||||
for (const [dep, rel] of Object.entries(workspace.patchedDependencies ?? {})) {
|
||||
const absolute = path.join(\"/app\", rel);
|
||||
if (!fs.existsSync(absolute)) {
|
||||
throw new Error(`missing patch for ${dep}: ${rel}`);
|
||||
@@ -321,7 +322,22 @@ jobs:
|
||||
env:
|
||||
IMAGE_REF: ${{ needs.root_dockerfile_image.outputs.image_ref }}
|
||||
run: |
|
||||
docker run --rm --entrypoint sh "$IMAGE_REF" -lc 'which openclaw && openclaw --version'
|
||||
docker run --rm --entrypoint sh "$IMAGE_REF" -lc '
|
||||
which openclaw &&
|
||||
openclaw --version &&
|
||||
node -e "
|
||||
const fs = require(\"node:fs\");
|
||||
const path = require(\"node:path\");
|
||||
const YAML = require(\"yaml\");
|
||||
const workspace = YAML.parse(fs.readFileSync(\"/app/pnpm-workspace.yaml\", \"utf8\")) ?? {};
|
||||
for (const [dep, rel] of Object.entries(workspace.patchedDependencies ?? {})) {
|
||||
const absolute = path.join(\"/app\", rel);
|
||||
if (!fs.existsSync(absolute)) {
|
||||
throw new Error(`missing patch for ${dep}: ${rel}`);
|
||||
}
|
||||
}
|
||||
"
|
||||
'
|
||||
|
||||
- name: Run agents delete shared workspace Docker CLI smoke
|
||||
env:
|
||||
|
||||
@@ -168,6 +168,7 @@ RUN chown node:node /app
|
||||
COPY --from=runtime-assets --chown=node:node /app/dist ./dist
|
||||
COPY --from=runtime-assets --chown=node:node /app/node_modules ./node_modules
|
||||
COPY --from=runtime-assets --chown=node:node /app/package.json .
|
||||
COPY --from=runtime-assets --chown=node:node /app/pnpm-workspace.yaml .
|
||||
COPY --from=runtime-assets --chown=node:node /app/patches ./patches
|
||||
COPY --from=runtime-assets --chown=node:node /app/openclaw.mjs .
|
||||
COPY --from=runtime-assets --chown=node:node /app/${OPENCLAW_BUNDLED_PLUGIN_DIR} ./${OPENCLAW_BUNDLED_PLUGIN_DIR}
|
||||
|
||||
@@ -134,6 +134,9 @@ describe("Dockerfile", () => {
|
||||
expect(dockerfile).toContain(
|
||||
"COPY --from=runtime-assets --chown=node:node /app/node_modules ./node_modules",
|
||||
);
|
||||
expect(dockerfile).toContain(
|
||||
"COPY --from=runtime-assets --chown=node:node /app/pnpm-workspace.yaml .",
|
||||
);
|
||||
expect(dockerfile).toContain(
|
||||
"COPY --from=runtime-assets --chown=node:node /app/patches ./patches",
|
||||
);
|
||||
@@ -146,6 +149,9 @@ describe("Dockerfile", () => {
|
||||
};
|
||||
|
||||
expect(Object.keys(pnpmWorkspace.patchedDependencies ?? {})).not.toHaveLength(0);
|
||||
expect(dockerfile).toContain(
|
||||
"COPY --from=runtime-assets --chown=node:node /app/pnpm-workspace.yaml .",
|
||||
);
|
||||
expect(dockerfile).toContain(
|
||||
"COPY --from=runtime-assets --chown=node:node /app/patches ./patches",
|
||||
);
|
||||
|
||||
@@ -89,7 +89,7 @@ describe("pi package graph guardrails", () => {
|
||||
|
||||
expectNoGraphViolations(
|
||||
piOverrides,
|
||||
`pnpm.overrides must not target Pi packages. Found: ${piOverrides.join(", ") || "<none>"}. Pi-specific overrides can silently create an unsupported package graph.`,
|
||||
`pnpm-workspace.yaml overrides must not target Pi packages. Found: ${piOverrides.join(", ") || "<none>"}. Pi-specific overrides can silently create an unsupported package graph.`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -229,6 +229,9 @@ describe("bun global install smoke", () => {
|
||||
expect(workflow).not.toContain('timeout 300s docker pull "$IMAGE_REF"');
|
||||
expect(workflow).toContain("--progress=plain");
|
||||
expect(workflow).toContain("--load");
|
||||
expect(workflow).toContain("pnpm-workspace.yaml");
|
||||
expect(workflow).toContain("workspace.patchedDependencies");
|
||||
expect(workflow).not.toContain("pkg.pnpm?.patchedDependencies");
|
||||
expect(workflow).not.toContain("--cache-from");
|
||||
expect(workflow).not.toContain("--cache-to");
|
||||
expect(workflow).not.toContain("type=gha");
|
||||
|
||||
Reference in New Issue
Block a user