Files
acdl/scripts/run_ci.sh
T
Jon Chery b758a7c242 refactor(P21): rename acdl_platform/ -> core/ (REQ-53)
---ci---
project: acdl
phase: 21
milestone: v1.6
status: execute
---/ci---

Rename the acdl_platform/ package to core/ across the directory, all
imports in tests/scripts/pipelines/workflows, and doc references. The
package is imported as core.confidence_signal / core.contract_resolver /
core.outbox_writer. The deploy workflow's platform-repo checkout dir is
renamed acdl-platform/ -> platform/ (workspace path, not the python
package). Both .gitea + .github workflows stay byte-identical.

Note: the original target name 'platform/' shadows Python's stdlib
platform module (pytest's import uuid -> platform.system() fails when
the repo root is on sys.path, which every test does). 'core/' avoids
the clash while honoring the intent (drop the verbose acdl_platform).

Tests: 154 pass. run_ci.sh green.
2026-07-22 18:21:12 +00:00

65 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# scripts/run_ci.sh - reproduce the CI pipeline locally.
#
# Mirrors the central pipeline contract (pipelines/ci.yaml) which both
# .gitea/workflows/ci.yml (Gitea Actions, dev) and
# .github/workflows/ci.yml (GitHub Actions, production) implement.
#
# Runs the same three stages in the same order:
# 1. lint — py_compile all Python files
# 2. test — pytest test suite (offline)
# 3. check-only — run_platform.sh --check-only (offline, no AWS)
#
# Fails on the first stage that errors. Exits 0 with "CI PIPELINE OK"
# when all stages pass.
#
# Usage:
# bash scripts/run_ci.sh # run all stages
# bash scripts/run_ci.sh --quiet # suppress per-stage banners
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
QUIET=0
for arg in "$@"; do
case "$arg" in
--quiet) QUIET=1 ;;
*) echo "FAIL: unknown argument: $arg" >&2; exit 1 ;;
esac
done
banner() {
[ "$QUIET" = "1" ] || echo ""
echo "── $1 ──"
[ "$QUIET" = "1" ] || echo ""
}
fail() { echo "FAIL: $*" >&2; exit 1; }
echo "=== ACDL CI Pipeline (local reproduction) ==="
echo "contract: pipelines/ci.yaml (3 stages)"
echo ""
banner "Stage 1/3: lint (py_compile)"
python3 -m py_compile \
core/confidence_signal.py \
core/outbox_writer.py \
core/contract_resolver.py \
adapters/terraform/adapter.py \
adapters/terraform/policy/checkov_adapter.py \
scripts/push_consumer_image.py \
|| fail "lint: py_compile failed"
echo "lint: OK"
banner "Stage 2/3: test (pytest)"
python3 -m pytest tests/ -v --tb=short || fail "test: pytest failed"
echo "test: OK"
banner "Stage 3/3: check-only (run_platform.sh --check-only)"
bash scripts/run_platform.sh --check-only || fail "check-only: run_platform.sh failed"
echo "check-only: OK"
echo ""
echo "=== CI PIPELINE OK ==="
echo "3 stages passed: lint, test, check-only"
exit 0