Add Gitea runner smoke test
This commit is contained in:
72
.gitea/workflows/smoke.yml
Normal file
72
.gitea/workflows/smoke.yml
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
name: Gitea Runner Smoke Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches: [ main, master ]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
smoke:
|
||||||
|
# Use the exact label your runner registered with.
|
||||||
|
runs-on: [oracle9-runner]
|
||||||
|
timeout-minutes: 15
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Show environment info
|
||||||
|
run: |
|
||||||
|
echo "User: $(whoami)"
|
||||||
|
echo "Host: $(hostname)"
|
||||||
|
uname -a
|
||||||
|
echo "---- /etc/os-release ----"
|
||||||
|
cat /etc/os-release || true
|
||||||
|
echo "---- CPU ----"
|
||||||
|
lscpu | egrep 'Model name|CPU\\(s\\)|Thread|Core' || true
|
||||||
|
echo "---- Mem/Disk ----"
|
||||||
|
free -h || true
|
||||||
|
df -h || true
|
||||||
|
|
||||||
|
- name: Shell sanity checks
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
test $((2+2)) -eq 4
|
||||||
|
echo "smoke: ok ✅" | tee smoke.txt
|
||||||
|
|
||||||
|
- name: Python quick test
|
||||||
|
run: |
|
||||||
|
python3 - <<'PY'
|
||||||
|
assert 6 * 7 == 42
|
||||||
|
print("python ok ✅")
|
||||||
|
PY
|
||||||
|
|
||||||
|
- name: Network sanity
|
||||||
|
run: |
|
||||||
|
getent hosts gitea.local || true
|
||||||
|
curl -sI https://www.example.com | head -n1
|
||||||
|
|
||||||
|
- name: Upload artifact (proof the job ran)
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: smoke-output
|
||||||
|
path: smoke.txt
|
||||||
|
|
||||||
|
# Optional: verifies container runtime if present (Docker or Podman-Docker socket)
|
||||||
|
container-check:
|
||||||
|
runs-on: [oracle9-runner]
|
||||||
|
needs: [smoke]
|
||||||
|
steps:
|
||||||
|
- name: Check container runtime
|
||||||
|
run: |
|
||||||
|
if command -v docker >/dev/null 2>&1; then
|
||||||
|
docker info >/dev/null
|
||||||
|
docker run --rm hello-world || true
|
||||||
|
else
|
||||||
|
echo "No docker/podman-docker found — skipping."
|
||||||
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user