Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (deploy) (push) Successful in 4m54s
Foundation / checks (postgres) (push) Failing after 8m46s
Foundation / checks (network) (push) Successful in 15m41s
Foundation / checks (client) (push) Successful in 17m3s
Foundation / checks (tsan) (push) Successful in 45m3s
Foundation / checks (checks) (push) Successful in 1h27m38s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
A push's diff against its before SHA counts every commit it carries, and any tests/ change selected checks, tsan and ecs. Run 475 spent 1h44m in checks for two commits that only touched tests/region_store_tests.cpp, which the native suites never build. Sources compiled only into evo-postgres-tests now select the PostgreSQL suites alone; the PostgreSQL image runs the repository format check so they stay formatted. Native CI stages compile with CI_BUILD_JOBS (default 4, previously a fixed 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
99 lines
6.0 KiB
Bash
99 lines
6.0 KiB
Bash
#!/usr/bin/env bash
|
|
# Offline regression for tools/ci/ci-paths.sh (review M8 P2) in a disposable Git
|
|
# repository: multi-commit pushes ending in documentation, missing and unknown bases,
|
|
# pull requests, manual dispatch, and changes to only a check script. Uncertainty
|
|
# must run validation. Run by the deploy suite before it decides anything.
|
|
set -euo pipefail
|
|
script="$(cd "$(dirname "$0")" && pwd)/ci-paths.sh"
|
|
repo="$(mktemp -d /tmp/evo-ci-paths.XXXXXXXX)"
|
|
trap 'rm -rf -- "$repo"' EXIT
|
|
cd "$repo"
|
|
git init -q
|
|
git config user.email ci@example.invalid
|
|
git config user.name ci
|
|
mkdir -p src docs tools/ci
|
|
echo base > src/a.cpp; echo base > docs/a.md; echo base > tools/ci/dr-check.sh
|
|
git add .; git commit -qm base
|
|
base="$(git rev-parse HEAD)"
|
|
echo change >> src/a.cpp; git commit -qam implementation
|
|
echo change >> docs/a.md; git commit -qam documentation
|
|
docs_only_base="$(git rev-parse HEAD~1)"
|
|
failures=0
|
|
expect() { # expect <label> <0 run|1 skip> <env...> -- <suite>
|
|
local label="$1" want="$2"; shift 2
|
|
local envs=()
|
|
while [ "$1" != -- ]; do envs+=("$1"); shift; done
|
|
shift
|
|
local got=0
|
|
env -u GITHUB_EVENT_BEFORE -u GITHUB_EVENT_NAME -u CI_EVENT -u CI_BEFORE -u CI_PR_BASE \
|
|
"${envs[@]}" bash "$script" "$1" || got=$?
|
|
if [ "$got" = "$want" ]; then echo "ok $label"; else echo "FAIL $label: exit $got, wanted $want"; failures=$((failures + 1)); fi
|
|
}
|
|
expect "push: code then docs runs checks" 0 CI_EVENT=push "CI_BEFORE=$base" -- checks
|
|
expect "push: docs-only commit skips checks" 1 CI_EVENT=push "CI_BEFORE=$docs_only_base" -- checks
|
|
expect "push: no before SHA runs" 0 CI_EVENT=push -- checks
|
|
expect "push: all-zero before (new branch) runs" 0 CI_EVENT=push CI_BEFORE=0000000000000000000000000000000000000000 -- checks
|
|
expect "push: unknown, unfetchable base runs" 0 CI_EVENT=push CI_BEFORE=1111111111111111111111111111111111111111 -- checks
|
|
expect "pull request: base diff runs checks" 0 CI_EVENT=pull_request "CI_PR_BASE=$base" -- checks
|
|
expect "pull request: no base runs" 0 CI_EVENT=pull_request -- deploy
|
|
expect "manual dispatch always runs" 0 CI_EVENT=workflow_dispatch "CI_BEFORE=$docs_only_base" -- checks
|
|
expect "local run (no event) runs" 0 -- postgres
|
|
echo change >> tools/ci/dr-check.sh; git commit -qam dr-script
|
|
script_base="$(git rev-parse HEAD~1)"
|
|
expect "push: only dr-check.sh changed runs postgres" 0 CI_EVENT=push "CI_BEFORE=$script_base" -- postgres
|
|
expect "push: only dr-check.sh changed skips image" 1 CI_EVENT=push "CI_BEFORE=$script_base" -- image
|
|
life_base="$(git rev-parse HEAD)"
|
|
echo check > tools/ci/life-reservations-check.sql; git add .; git commit -qm life-check
|
|
expect "push: life reservation check runs postgres" 0 CI_EVENT=push "CI_BEFORE=$life_base" -- postgres
|
|
# Session control and cellular batch contract changes must smoke the server image.
|
|
server_contract_base="$(git rev-parse HEAD)"
|
|
mkdir -p tests
|
|
echo contract > tests/network_control.cpp
|
|
git add .; git commit -qm network-control-contract
|
|
expect "push: network control contract runs server image" 0 CI_EVENT=push "CI_BEFORE=$server_contract_base" -- server-image
|
|
batch_contract_base="$(git rev-parse HEAD)"
|
|
echo contract > tests/cellular_session_batch_tests.cpp
|
|
git add .; git commit -qm cellular-batch-contract
|
|
expect "push: cellular batch contract runs server image" 0 CI_EVENT=push "CI_BEFORE=$batch_contract_base" -- server-image
|
|
life_contract_base="$(git rev-parse HEAD)"
|
|
echo contract > tests/cellular_lives_tests.cpp
|
|
git add .; git commit -qm cellular-lives-contract
|
|
expect "push: cellular lives contract runs server image" 0 CI_EVENT=push "CI_BEFORE=$life_contract_base" -- server-image
|
|
migration_contract_base="$(git rev-parse HEAD)"
|
|
echo contract > tests/region_migration_tests.cpp
|
|
git add .; git commit -qm region-migration-contract
|
|
expect "push: region migration contract runs server image" 0 CI_EVENT=push "CI_BEFORE=$migration_contract_base" -- server-image
|
|
ops_contract_base="$(git rev-parse HEAD)"
|
|
echo contract > tests/region_ops_tests.cpp
|
|
git add .; git commit -qm region-ops-contract
|
|
expect "push: region ops contract runs server image" 0 CI_EVENT=push "CI_BEFORE=$ops_contract_base" -- server-image
|
|
# A PostgreSQL-only test runs the PostgreSQL suite, not the native suites that never build it.
|
|
postgres_test_base="$(git rev-parse HEAD)"
|
|
echo contract > tests/region_store_tests.cpp
|
|
git add .; git commit -qm region-store-test
|
|
expect "push: postgres-only test runs postgres" 0 CI_EVENT=push "CI_BEFORE=$postgres_test_base" -- postgres
|
|
expect "push: postgres-only test skips checks" 1 CI_EVENT=push "CI_BEFORE=$postgres_test_base" -- checks
|
|
expect "push: postgres-only test skips tsan" 1 CI_EVENT=push "CI_BEFORE=$postgres_test_base" -- tsan
|
|
native_test_base="$(git rev-parse HEAD)"
|
|
echo contract > tests/region_store_tests.cpp
|
|
echo contract > tests/photosynthesis_tests.cpp
|
|
git add .; git commit -qm mixed-tests
|
|
expect "push: a native test with it still runs checks" 0 CI_EVENT=push "CI_BEFORE=$native_test_base" -- checks
|
|
# Client dependency updates must select the isolated client gate.
|
|
mkdir -p tools
|
|
client_base="$(git rev-parse HEAD)"
|
|
echo pin > tools/sdl3-pin.cmake; git add .; git commit -qm client-pin
|
|
expect "push: SDL pin runs client" 0 CI_EVENT=push "CI_BEFORE=$client_base" -- client
|
|
ui_base="$(git rev-parse HEAD)"
|
|
echo pin > tools/imgui-pin.cmake; git add .; git commit -qm ui-pin
|
|
expect "push: ImGui pin runs client" 0 CI_EVENT=push "CI_BEFORE=$ui_base" -- client
|
|
client_test_base="$(git rev-parse HEAD)"
|
|
echo client-test > tests/client_lifecycle.cpp; git add .; git commit -qm client-lifecycle-test
|
|
expect "push: client lifecycle test runs client" 0 CI_EVENT=push "CI_BEFORE=$client_test_base" -- client
|
|
# A TLS dependency update must select the isolated network gate, not only the image.
|
|
network_base="$(git rev-parse HEAD)"
|
|
echo pin > tools/mbedtls-pin.cmake; git add .; git commit -qm network-pin
|
|
expect "push: Mbed TLS pin runs network" 0 CI_EVENT=push "CI_BEFORE=$network_base" -- network
|
|
expect "push: Mbed TLS pin skips deploy" 1 CI_EVENT=push "CI_BEFORE=$network_base" -- deploy
|
|
[ "$failures" = 0 ] && echo "ci path selection fixtures passed" || { echo "$failures fixture(s) failed"; exit 1; }
|