ci: retry + explicit Node 20 version check в bootstrap
Symptom (run #1826 fail на u4-runner): Bootstrap step молча установил Node 12 (Ubuntu default) вместо Node 20 из NodeSource → actions/checkout@v4 не парсится (ES2022 static blocks). Cause: curl ... setup_20.x на slow network (u4 через VPN) timeout/fail silently, apt install fallback на default ubuntu nodejs (Node 12). Без error. Fix: - curl --retry 3 --retry-delay 5 --connect-timeout 30 - retry-loop на NodeSource setup (3 попытки) - явная verification major version >= 18 после install, fail с exit 1 если установился Node < 18 Применяется к обоим jobs (cmake-build и filter-build). Связано: PR #4 (v0.2), run #1826 fail.
This commit is contained in:
@@ -25,12 +25,30 @@ jobs:
|
||||
# Ставим Node 20 из NodeSource repo.
|
||||
- name: Bootstrap Node 20 + git (для actions/checkout)
|
||||
run: |
|
||||
set -e
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends curl git ca-certificates gnupg
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||
# NodeSource setup может молча упасть на slow networks (особенно через VPN
|
||||
# на u4-runner); retry + явная verification что Node >= 18 после install.
|
||||
for i in 1 2 3; do
|
||||
if curl -fsSL --retry 3 --retry-delay 5 --connect-timeout 30 \
|
||||
https://deb.nodesource.com/setup_20.x | bash -; then
|
||||
break
|
||||
fi
|
||||
echo "NodeSource setup attempt $i failed, retrying..."
|
||||
sleep 10
|
||||
done
|
||||
apt-get install -y --no-install-recommends nodejs
|
||||
node --version
|
||||
NODE_VER=$(node --version)
|
||||
echo "node: $NODE_VER"
|
||||
# actions/checkout@v4 требует Node 20+ (ES2022 static blocks).
|
||||
# Если NodeSource setup упал и установился Ubuntu's Node 12 — фейлим явно.
|
||||
NODE_MAJOR=$(echo "$NODE_VER" | sed -E 's/^v([0-9]+).*/\1/')
|
||||
if [ "$NODE_MAJOR" -lt 18 ]; then
|
||||
echo "ERROR: Node $NODE_VER too old, NodeSource setup likely failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install build deps
|
||||
run: |
|
||||
@@ -80,12 +98,30 @@ jobs:
|
||||
steps:
|
||||
- name: Bootstrap Node 20 + git (для actions/checkout)
|
||||
run: |
|
||||
set -e
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends curl git ca-certificates gnupg
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||
# NodeSource setup может молча упасть на slow networks (особенно через VPN
|
||||
# на u4-runner); retry + явная verification что Node >= 18 после install.
|
||||
for i in 1 2 3; do
|
||||
if curl -fsSL --retry 3 --retry-delay 5 --connect-timeout 30 \
|
||||
https://deb.nodesource.com/setup_20.x | bash -; then
|
||||
break
|
||||
fi
|
||||
echo "NodeSource setup attempt $i failed, retrying..."
|
||||
sleep 10
|
||||
done
|
||||
apt-get install -y --no-install-recommends nodejs
|
||||
node --version
|
||||
NODE_VER=$(node --version)
|
||||
echo "node: $NODE_VER"
|
||||
# actions/checkout@v4 требует Node 20+ (ES2022 static blocks).
|
||||
# Если NodeSource setup упал и установился Ubuntu's Node 12 — фейлим явно.
|
||||
NODE_MAJOR=$(echo "$NODE_VER" | sed -E 's/^v([0-9]+).*/\1/')
|
||||
if [ "$NODE_MAJOR" -lt 18 ]; then
|
||||
echo "ERROR: Node $NODE_VER too old, NodeSource setup likely failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install build deps
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user