mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
ci: relax platform checkout fetch timeout (#88199)
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -1672,6 +1672,7 @@ jobs:
|
||||
git init "$GITHUB_WORKSPACE"
|
||||
git -C "$GITHUB_WORKSPACE" config gc.auto 0
|
||||
git -C "$GITHUB_WORKSPACE" remote add origin "https://github.com/${CHECKOUT_REPO}.git"
|
||||
fetch_timeout_seconds=90
|
||||
fetch_checkout_ref() {
|
||||
git -C "$GITHUB_WORKSPACE" \
|
||||
-c protocol.version=2 \
|
||||
@@ -1680,7 +1681,7 @@ jobs:
|
||||
local fetch_pid="$!"
|
||||
local elapsed=0
|
||||
while kill -0 "$fetch_pid" 2>/dev/null; do
|
||||
if [ "$elapsed" -ge 30 ]; then
|
||||
if [ "$elapsed" -ge "$fetch_timeout_seconds" ]; then
|
||||
kill -TERM "$fetch_pid" 2>/dev/null || true
|
||||
sleep 10
|
||||
kill -KILL "$fetch_pid" 2>/dev/null || true
|
||||
@@ -1792,6 +1793,7 @@ jobs:
|
||||
git init "$GITHUB_WORKSPACE"
|
||||
git -C "$GITHUB_WORKSPACE" config gc.auto 0
|
||||
git -C "$GITHUB_WORKSPACE" remote add origin "https://github.com/${CHECKOUT_REPO}.git"
|
||||
fetch_timeout_seconds=90
|
||||
fetch_checkout_ref() {
|
||||
git -C "$GITHUB_WORKSPACE" \
|
||||
-c protocol.version=2 \
|
||||
@@ -1800,7 +1802,7 @@ jobs:
|
||||
local fetch_pid="$!"
|
||||
local elapsed=0
|
||||
while kill -0 "$fetch_pid" 2>/dev/null; do
|
||||
if [ "$elapsed" -ge 30 ]; then
|
||||
if [ "$elapsed" -ge "$fetch_timeout_seconds" ]; then
|
||||
kill -TERM "$fetch_pid" 2>/dev/null || true
|
||||
sleep 10
|
||||
kill -KILL "$fetch_pid" 2>/dev/null || true
|
||||
@@ -1858,6 +1860,7 @@ jobs:
|
||||
git init "$GITHUB_WORKSPACE"
|
||||
git -C "$GITHUB_WORKSPACE" config gc.auto 0
|
||||
git -C "$GITHUB_WORKSPACE" remote add origin "https://github.com/${CHECKOUT_REPO}.git"
|
||||
fetch_timeout_seconds=90
|
||||
fetch_checkout_ref() {
|
||||
git -C "$GITHUB_WORKSPACE" \
|
||||
-c protocol.version=2 \
|
||||
@@ -1866,7 +1869,7 @@ jobs:
|
||||
local fetch_pid="$!"
|
||||
local elapsed=0
|
||||
while kill -0 "$fetch_pid" 2>/dev/null; do
|
||||
if [ "$elapsed" -ge 30 ]; then
|
||||
if [ "$elapsed" -ge "$fetch_timeout_seconds" ]; then
|
||||
kill -TERM "$fetch_pid" 2>/dev/null || true
|
||||
sleep 10
|
||||
kill -KILL "$fetch_pid" 2>/dev/null || true
|
||||
|
||||
@@ -74,10 +74,14 @@ describe("ci workflow guards", () => {
|
||||
const checkoutStep = workflow.jobs[jobName].steps.find((step) => step.name === "Checkout");
|
||||
|
||||
expect(checkoutStep.run, jobName).toContain("fetch_checkout_ref()");
|
||||
expect(checkoutStep.run, jobName).toContain("fetch_timeout_seconds=90");
|
||||
expect(checkoutStep.run, jobName).toContain("-c protocol.version=2");
|
||||
expect(checkoutStep.run, jobName).toContain(
|
||||
"fetch --no-tags --prune --no-recurse-submodules --depth=1 origin",
|
||||
);
|
||||
expect(checkoutStep.run, jobName).toContain(
|
||||
'if [ "$elapsed" -ge "$fetch_timeout_seconds" ]; then',
|
||||
);
|
||||
expect(checkoutStep.run, jobName).toContain('kill -TERM "$fetch_pid"');
|
||||
expect(checkoutStep.run, jobName).toContain('kill -KILL "$fetch_pid"');
|
||||
expect(checkoutStep.run, jobName).not.toContain(
|
||||
|
||||
Reference in New Issue
Block a user