mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
fix(ci): reset SwiftPM state between build retries
This commit is contained in:
parent
de6c1b04ad
commit
f20ebb36f5
2 changed files with 20 additions and 0 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
|
@ -1784,7 +1784,13 @@ jobs:
|
|||
if swift build --package-path apps/macos --product OpenClaw --configuration release; then
|
||||
exit 0
|
||||
fi
|
||||
if [[ "$attempt" -eq 3 ]]; then
|
||||
break
|
||||
fi
|
||||
echo "swift build failed (attempt $attempt/3). Retrying…"
|
||||
# SwiftPM can invalidate a restored binary artifact while planning.
|
||||
# Reset so the next attempt downloads a complete dependency graph.
|
||||
swift package --package-path apps/macos reset
|
||||
sleep $((attempt * 20))
|
||||
done
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -455,6 +455,20 @@ describe("ci workflow guards", () => {
|
|||
}
|
||||
});
|
||||
|
||||
it("resets SwiftPM state between macOS release build retries", () => {
|
||||
const workflow = readCiWorkflow();
|
||||
const buildStep = workflow.jobs["macos-swift"].steps.find(
|
||||
(step) => step.name === "Swift build (release)",
|
||||
);
|
||||
|
||||
expect(buildStep.run).toContain("for attempt in 1 2 3");
|
||||
expect(buildStep.run).toContain('if [[ "$attempt" -eq 3 ]]; then');
|
||||
expect(buildStep.run).toContain("swift package --package-path apps/macos reset");
|
||||
expect(buildStep.run.indexOf("swift package --package-path apps/macos reset")).toBeGreaterThan(
|
||||
buildStep.run.indexOf("swift build failed"),
|
||||
);
|
||||
});
|
||||
|
||||
it("bounds the Windows Crabbox hydrate main fetch", () => {
|
||||
const workflow = readFileSync(".github/workflows/crabbox-hydrate.yml", "utf8");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue