ci: retry + explicit Node 20 version check в bootstrap
build / cmake build (CUDA 12.4, Ubuntu 22.04) (pull_request) Successful in 6m24s
build / ffmpeg filter patch (out-of-tree) (pull_request) Successful in 6m21s

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:
2026-05-19 17:31:33 +01:00
parent fca07bf669
commit 2b94742df4
+40 -4
View File
@@ -25,12 +25,30 @@ jobs:
# Ставим Node 20 из NodeSource repo. # Ставим Node 20 из NodeSource repo.
- name: Bootstrap Node 20 + git (для actions/checkout) - name: Bootstrap Node 20 + git (для actions/checkout)
run: | run: |
set -e
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get update apt-get update
apt-get install -y --no-install-recommends curl git ca-certificates gnupg 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 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 - name: Install build deps
run: | run: |
@@ -80,12 +98,30 @@ jobs:
steps: steps:
- name: Bootstrap Node 20 + git (для actions/checkout) - name: Bootstrap Node 20 + git (для actions/checkout)
run: | run: |
set -e
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get update apt-get update
apt-get install -y --no-install-recommends curl git ca-certificates gnupg 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 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 - name: Install build deps
run: | run: |