fix: retry all repo clones + fail loudly on missing pom/package.json (emulator clone was silently empty)

This commit is contained in:
openhands committed 2026-07-20 19:07:03 +02:00
1 parent acdbcdf36e
commit c4a0c607bf
1 file changed
+35 -10
+35 -10
View File
@@ -107,10 +107,14 @@ jobs:
S="$CACHE_DIR/catalogus"; mkdir -p "$S"
if [ "${{ steps.check.outputs.cat_ref }}" != "$(cat "$S/ref" 2>/dev/null)" ]; then
rm -rf "$WORK/src/catalogus"
git clone --depth 1 --filter=blob:none --sparse \
https://gitlab.epicnabbo.nl/remco/Epicnabbo-Catalogus-Updated-Daily.git "$WORK/src/catalogus" 2>/dev/null \
|| git -C "$WORK/src/catalogus" pull --ff-only 2>/dev/null
# Keep only what the pack actually needs (adjust paths as required).
for attempt in 1 2 3; do
if git clone --depth 1 --filter=blob:none --sparse \
https://gitlab.epicnabbo.nl/remco/Epicnabbo-Catalogus-Updated-Daily.git "$WORK/src/catalogus" 2>/dev/null; then
break
fi
echo "Catalogus clone attempt $attempt failed, retrying..." >&2
sleep 5
done
git -C "$WORK/src/catalogus" sparse-checkout set . 2>/dev/null || true
echo "${{ steps.check.outputs.cat_ref }}" > "$S/ref"
rm -rf "$S/snapshot"; cp -r "$WORK/src/catalogus" "$S/snapshot"
@@ -128,8 +132,15 @@ jobs:
# Nitro-V3's vite.config expects the renderer at ../Nitro_Render_V3
RENDER_DIR="$WORK/src/Nitro_Render_V3"
if [ "${{ steps.check.outputs.render_ref }}" != "$(cat "$S/ref" 2>/dev/null)" ]; then
git clone --depth 1 https://github.com/duckietm/Nitro_Render_V3.git "$RENDER_DIR" 2>/dev/null \
|| git -C "$RENDER_DIR" pull --ff-only 2>/dev/null
rm -rf "$RENDER_DIR"
for attempt in 1 2 3; do
if git clone --depth 1 https://github.com/duckietm/Nitro_Render_V3.git "$RENDER_DIR" 2>/dev/null; then
break
fi
echo "Render clone attempt $attempt failed, retrying..." >&2
sleep 5
done
[ -f "$RENDER_DIR/package.json" ] || { echo "Render clone failed"; exit 1; }
cd "$RENDER_DIR"
yarn install --frozen-lockfile --prefer-offline 2>&1 || yarn install 2>&1
rm -rf "$S/files"; mkdir -p "$S/files"; cp -r . "$S/files/" 2>/dev/null || true
@@ -148,8 +159,15 @@ jobs:
set -e
S="$CACHE_DIR/nitro"; mkdir -p "$S"
if [ "${{ steps.check.outputs.nitro_ref }}" != "$(cat "$S/ref" 2>/dev/null)" ]; then
git clone --depth 1 https://github.com/duckietm/Nitro-V3.git "$WORK/src/nitro" 2>/dev/null \
|| git -C "$WORK/src/nitro" pull --ff-only 2>/dev/null
rm -rf "$WORK/src/nitro"
for attempt in 1 2 3; do
if git clone --depth 1 https://github.com/duckietm/Nitro-V3.git "$WORK/src/nitro" 2>/dev/null; then
break
fi
echo "Nitro clone attempt $attempt failed, retrying..." >&2
sleep 5
done
[ -f "$WORK/src/nitro/package.json" ] || { echo "Nitro clone failed"; exit 1; }
cd "$WORK/src/nitro"
yarn install --frozen-lockfile --prefer-offline 2>&1 || yarn install 2>&1
yarn build
@@ -167,8 +185,15 @@ jobs:
set -e
S="$CACHE_DIR/emulator"; mkdir -p "$S"
if [ "${{ steps.check.outputs.emu_ref }}" != "$(cat "$S/ref" 2>/dev/null)" ]; then
git clone --depth 1 https://github.com/duckietm/Polaris-Emulator.git "$WORK/src/emulator" 2>/dev/null \
|| git -C "$WORK/src/emulator" pull --ff-only 2>/dev/null
rm -rf "$WORK/src/emulator"
for attempt in 1 2 3; do
if git clone --depth 1 https://github.com/duckietm/Polaris-Emulator.git "$WORK/src/emulator" 2>/dev/null; then
break
fi
echo "Emulator clone attempt $attempt failed, retrying..." >&2
sleep 5
done
[ -f "$WORK/src/emulator/pom.xml" ] || { echo "Emulator clone failed (no pom.xml)"; exit 1; }
cd "$WORK/src/emulator"
mvn package -q -T 1C -o -Dmaven.test.skip=true 2>&1 \
|| mvn package -q -T 1C -Dmaven.test.skip=true 2>&1