ci: probe Docker through the runner socket
runner-probe / probe (push) Successful in 7s

This commit is contained in:
2026-09-23 22:36:34 +08:00
parent c3025567c8
commit f3dd8f8701
2 changed files with 144 additions and 55 deletions
+3 -55
View File
@@ -5,6 +5,7 @@ on:
branches: [main]
paths:
- ".gitea/workflows/runner-probe.yml"
- ".gitea/scripts/runner-probe.mjs"
workflow_dispatch:
jobs:
@@ -23,58 +24,5 @@ jobs:
id
df -h /
- name: Check Docker and the persistent service
run: |
set -eu
if ! command -v docker >/dev/null 2>&1; then
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker.io
fi
docker version --format 'client {{.Client.Version}} / server {{.Server.Version}}'
docker ps -a --format 'container={{.Names}} status={{.Status}} image={{.Image}}'
docker volume ls --format 'volume={{.Name}}'
- name: Find the uploaded Iowa algebra PDF
run: |
set -eu
target=uiowa-algebra.pdf
found=0
for root in "$GITHUB_WORKSPACE" /books /data /srv /opt /workspace; do
if [ -d "$root" ]; then
while IFS= read -r path; do
[ -n "$path" ] || continue
found=1
echo "FOUND host:$path"
stat -c 'size=%s bytes modified=%y' "$path" 2>/dev/null || ls -lh "$path"
sha256sum "$path" 2>/dev/null || true
done <<EOF
$(find "$root" -maxdepth 5 -type f -name "$target" 2>/dev/null || true)
EOF
fi
done
if command -v docker >/dev/null 2>&1; then
if docker ps -a --format '{{.Names}}' | grep -qx lean-bench; then
if docker exec lean-bench test -f "/books/$target"; then
found=1
echo "FOUND container:lean-bench:/books/$target"
docker exec lean-bench sh -c "ls -lh '/books/$target'; sha256sum '/books/$target'"
fi
fi
if docker volume inspect lean-bench-books >/dev/null 2>&1; then
if docker run --rm -v lean-bench-books:/books:ro node:16-bullseye \
test -f "/books/$target"; then
found=1
echo "FOUND volume:lean-bench-books:$target"
docker run --rm -v lean-bench-books:/books:ro node:16-bullseye \
sh -c "ls -lh '/books/$target'; sha256sum '/books/$target'"
fi
fi
fi
if [ "$found" -eq 0 ]; then
echo "NOT_FOUND: $target"
exit 2
fi
- name: Check Docker and find the uploaded Iowa algebra PDF
run: node .gitea/scripts/runner-probe.mjs