Files
the-nexus/.gitea/workflows/ci.yml
Bezalel 36e1db9ae1
Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
Staging Verification Gate / verify-staging (push) Has been cancelled
CI / test (pull_request) Failing after 16s
CI / validate (pull_request) Failing after 12s
Review Approval Gate / verify-review (pull_request) Failing after 4s
fix(ci): repair bash syntax in validate job and add missing requirements.txt
- Fix empty 'then' block in Python syntax validation loop
- Add minimal requirements.txt for pytest/pytest-asyncio/pyyaml
2026-04-07 15:16:19 +00:00

99 lines
2.9 KiB
YAML

name: CI
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
pytest tests/
- name: Validate palace taxonomy
run: |
pip install pyyaml -q
python3 mempalace/validate_rooms.py docs/mempalace/bezalel_example.yaml
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate Python syntax
run: |
FAIL=0
for f in $(find . -name '*.py' -not -path './venv/*'); do
if python3 -c "import py_compile; py_compile.compile('$f', doraise=True)" 2>/dev/null; then
echo "OK: $f"
else
echo "FAIL: $f"
FAIL=1
fi
done
exit $FAIL
- name: Validate JSON
run: |
FAIL=0
for f in $(find . -name '*.json' -not -path './venv/*'); do
if ! python3 -c "import json; json.load(open('$f'))" 2>/dev/null; then
echo "FAIL: $f"
FAIL=1
else
echo "OK: $f"
fi
done
exit $FAIL
- name: Repo Truth Guard
run: |
python3 scripts/repo_truth_guard.py
- name: Validate YAML
run: |
pip install pyyaml -q
FAIL=0
for f in $(find . -name '*.yaml' -o -name '*.yml' | grep -v '.gitea/'); do
if ! python3 -c "import yaml; yaml.safe_load(open('$f'))"; then
echo "FAIL: $f"
FAIL=1
else
echo "OK: $f"
fi
done
exit $FAIL
- name: "HARD RULE: 10-line net addition limit"
run: |
ADDITIONS=$(git diff --numstat origin/main...HEAD | awk '{s+=$1} END {print s+0}')
DELETIONS=$(git diff --numstat origin/main...HEAD | awk '{s+=$2} END {print s+0}')
NET=$((ADDITIONS - DELETIONS))
echo "Additions: +$ADDITIONS | Deletions: -$DELETIONS | Net: $NET"
if [ "$NET" -gt 10 ]; then
echo ""
echo "═══════════════════════════════════════════════════"
echo " BLOCKED: Net addition is $NET lines (max: 10)."
echo " Delete code elsewhere to compensate."
echo "═══════════════════════════════════════════════════"
exit 1
fi
echo "✓ Net addition ($NET) within 10-line limit."