Files
admin d6e2317016
ABSDEV Framework CI / framework-validation (push) Canceled after 0s
Initial ABSDEV deployment framework development preview
2026-11-26 11:35:28 +00:00

147 lines
2.8 KiB
Bash
Executable File

#!/usr/bin/env bash
set -Eeuo pipefail
umask 077
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)"
cd "$ROOT"
export PYTHONDONTWRITEBYTECODE=1
export PYTHONUNBUFFERED=1
export ABSDEV_INTEGRATION_TESTS=0
echo "=== ABSDEV FRAMEWORK CI ==="
python3 --version
echo
echo "=== PYTHON SYNTAX VALIDATION ==="
python3 -B <<'PY'
from pathlib import Path
files = []
for directory in ("core", "adapters", "tests"):
files.extend(
sorted(Path(directory).rglob("*.py"))
)
files.extend([
Path("bin/absdev-deploy"),
Path("bin/absdev-deploy-validate.py"),
])
for path in files:
if path.is_symlink() or not path.is_file():
raise SystemExit(
f"Unsafe Python source: {path}"
)
compile(
path.read_bytes(),
str(path),
"exec",
)
print(f"PASS: {len(files)} Python sources compiled")
PY
echo
echo "=== COMPLETE UNIT REGRESSION SUITE ==="
python3 -B -m unittest discover -s tests/unit
echo
echo "=== VERIFY PRODUCTION CAPABILITY RESTRICTIONS ==="
python3 -B <<'PY'
import json
import subprocess
import sys
result = subprocess.run(
[
sys.executable,
"bin/absdev-deploy",
"capabilities",
],
capture_output=True,
text=True,
timeout=15,
check=True,
)
report = json.loads(result.stdout)
for field in (
"production_ready",
"deployment_execution_enabled",
"migration_execution_enabled",
"provisioning_execution_enabled",
"database_restore_enabled",
"permanent_deletion_enabled",
):
if report.get(field) is not False:
raise SystemExit(
f"FAIL: Unsafe capability: {field}"
)
print(f"PASS: {field}=false")
for command in (
"deploy",
"migrate",
"rollback",
"restore",
"provision",
"delete",
):
result = subprocess.run(
[
sys.executable,
"bin/absdev-deploy",
command,
],
capture_output=True,
timeout=15,
)
if result.returncode == 0:
raise SystemExit(
f"FAIL: Unexpected command: {command}"
)
print(f"PASS: Unsupported command rejected: {command}")
PY
echo
echo "=== EXAMPLE CONFIGURATION ==="
bin/absdev-deploy validate \
--config config/site.example.json
bin/absdev-deploy site-policy \
--config config/site.example.json
bin/absdev-deploy provision-plan \
--config config/site.example.json
echo
echo "=== REFERENCE INTEGRITY ==="
if [[ -e REFERENCE.sha256 ]]; then
sha256sum -c REFERENCE.sha256 >/dev/null
echo "PASS: Reference implementation unchanged"
else
echo "SKIP: Private reference excluded from checkout"
fi
echo
echo "========================================"
echo "PASS: FRAMEWORK CI"
echo "UNIT TESTS AND STATIC VALIDATION ONLY"
echo "DATABASE INTEGRATION NOT EXECUTED"
echo "========================================"