- Incidente 02:06:29Z: el rollback del autodeploy (git reset --hard $OLD) pisó la rama e2-fuentes-y-sellos porque el árbol cambió de branch a mitad de deploy. Causa: ninguna exclusión mutua entre autodeploy, auto-merger y ops manuales sobre los mismos árboles. - Lock: /run/lock/cayce-git-ops.lock (tmpfiles.d, 0664 root:ubuntu). autodeploy flock -n (salta ciclo), auto-merge flock -w 240 (espera). - Guard en ci.yml: un job cuyo workspace caiga bajo /srv/* revienta.
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint-test:
|
|
runs-on: ubuntu-latest
|
|
# r20: pipefail a nivel job — un - run: set -o pipefail en paso aparte NO
|
|
# persiste (cada paso es un shell nuevo) y el test roto de la demo #43
|
|
# siguio dando verde hasta ser auto-mergeado a main.
|
|
defaults:
|
|
run:
|
|
shell: bash --noprofile --norc -eo pipefail {0}
|
|
steps:
|
|
- name: "r31 guard: CI nunca opera en /srv/*"
|
|
run: |
|
|
case "$PWD" in
|
|
/srv/*) echo "VIOLACION: workspace de CI en $PWD"; exit 1 ;;
|
|
*) echo "workspace OK: $PWD" ;;
|
|
esac
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup
|
|
run: |
|
|
python3 -m pip install --user ruff pytest --quiet 2>/dev/null || true
|
|
|
|
- name: Lint (ruff, advisory)
|
|
run: |
|
|
if [ -d cayceops ]; then
|
|
ruff check cayceops/ --exit-zero || true
|
|
else
|
|
echo "no python package — OK"
|
|
fi
|
|
|
|
- name: Tests
|
|
run: |
|
|
if [ -d cayceops/tests ]; then
|
|
python3 -m pytest cayceops/tests/ -v --tb=short 2>&1 | tail -5
|
|
else
|
|
echo "no tests dir — OK"
|
|
fi
|
|
|
|
- name: Guard tests
|
|
run: |
|
|
if [ -f runtime/guard.test.mjs ]; then
|
|
cd runtime && node --test guard.test.mjs 2>&1 | tail -3 && cd ..
|
|
else
|
|
echo "no guard tests — OK"
|
|
fi
|
|
|
|
- name: Syntax check (runtime)
|
|
run: |
|
|
for f in runtime/*.mjs; do
|
|
[ -f "$f" ] && node --check "$f" || true
|
|
done
|
|
echo "syntax check OK"
|