ci: fix runner-3
Fix Final / fix (push) Failing after 0s
Fix Simple / fix (push) Failing after 0s
Diag SaaS Runner / diag (push) Successful in 3s
Runner Diagnose / diag (push) Successful in 3s
Fix Runner 3 / fix (push) Failing after 2s
Runner Diagnose / diagnose (push) Successful in 0s

This commit is contained in:
灵应
2026-07-12 02:24:24 +08:00
parent dafd9183ae
commit 3bc7b60df2
+44
View File
@@ -0,0 +1,44 @@
name: Fix Runner 3
on:
push:
branches:
- ci/runner-fix
jobs:
fix:
runs-on: runtime-builder
steps:
- name: fix r3
run: |
set -ex
CI_DIR="/var/lib/xiaoxia-ci"
ACT_BIN="$CI_DIR/act_runner"
GITEA_URL="https://git.xiaoxiajianji.com"
LABELS="saas,runtime-builder,host,ubuntu-latest"
TOKEN="1f8058d097e3942a9ed31c44382baf7f08311272"
echo "=== runner-3 status ==="
systemctl status act_runner-3.service 2>&1 | head -15 || true
echo ""
echo "=== runner-3 .runner file ==="
ls -la "$CI_DIR/runner-3/" || true
cat "$CI_DIR/runner-3/.runner" 2>/dev/null | head -5 || echo "no .runner file"
echo ""
echo "=== Re-registering runner-3 ==="
REG_TOKEN=$(curl -sk -X POST -H "Authorization: token $TOKEN" "$GITEA_URL/api/v1/repos/xiaoxia/xiaoxia-saas/actions/runners/registration-token" | python3 -c "import sys,json; print(json.load(sys.stdin).get('token',''))")
echo "token len: ${#REG_TOKEN}"
systemctl stop act_runner-3.service 2>&1 || true
sleep 2
cd "$CI_DIR/runner-3"
rm -f .runner
$ACT_BIN register --instance "$GITEA_URL" --token "$REG_TOKEN" --name "xiaoxia-ci-runner-3" --labels "$LABELS" --no-interactive
systemctl start act_runner-3.service
sleep 15
echo ""
echo "=== Final ==="
curl -sk -H "Authorization: token $TOKEN" "$GITEA_URL/api/v1/repos/xiaoxia/xiaoxia-saas/actions/runners?limit=50" > /tmp/r.json
python3 -c "import sys,json;d=json.load(open('/tmp/r.json'));online=[r for r in d['runners'] if r['status']=='online'];print(f'online: {len(online)}');[print(f' {r[\"name\"]}: {[l[\"name\"] for l in r[\"labels\"]]}') for r in online]"