Files
dingoandClaude Opus 5.5 6a9af9c514
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
ci: keep PostgreSQL-only tests out of the native suites; build with 4 jobs
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>
2026-10-20 18:22:44 -04:00

69 lines
4.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Decides whether a CI suite must run: exit 0 = run, exit 1 = nothing relevant changed.
#
# The comparison base comes from the event (review M8 P2), never from HEAD^ alone:
# - push: CI_BEFORE (the push's `before` SHA), so every commit of a multi-commit push
# counts, not just the last;
# - pull_request: CI_PR_BASE (the base SHA), diffed against the checked-out merge;
# - workflow_dispatch, schedule, a local run or any other event: always run.
# A missing, all-zero or unfetchable base, or any git failure, also runs the suite:
# uncertainty never skips validation. tools/ci/ci-paths-check.sh tests this offline.
set -euo pipefail
suite=${1:?suite required}
event="${CI_EVENT:-${GITHUB_EVENT_NAME:-}}"
case "$event" in
push) base="${CI_BEFORE:-${GITHUB_EVENT_BEFORE:-}}" ;;
pull_request) base="${CI_PR_BASE:-}" ;;
*) exit 0 ;;
esac
if [[ ! "$base" =~ ^[0-9a-f]{40}$ || "$base" == 0000000000000000000000000000000000000000 ]]; then
exit 0
fi
if ! git cat-file -e "$base^{commit}" 2> /dev/null; then
git fetch --no-tags --quiet --depth=1 origin "$base" > /dev/null 2>&1 || exit 0
git cat-file -e "$base^{commit}" 2> /dev/null || exit 0
fi
if ! files=$(git diff --name-only "$base" HEAD 2> /dev/null); then
exit 0
fi
# Every suite runs when the workflow or this selector changes.
common='\.gitea/workflows/|tools/ci/ci-paths\.sh'
native='CMakeLists\.txt|CMakePresets\.json|cmake/|include/|src/|apps/'
# Sources compiled only into evo-postgres-tests (CMakeLists.txt). The native suites never
# build them, so a change to one alone selects the PostgreSQL suites, not checks/tsan/ecs;
# the PostgreSQL image runs the repository format check for them instead.
postgres_only_tests='tests/(postgres_tests|region_lease_store_tests|cellular_publication_tests|population_publication_tests|environment_publication_tests|account_control_store_tests|probe_handoff_store_tests|life_reservation_store_tests|primitive_publication_tests|region_action_tests|region_checkpoint_store_tests|region_host_tests|region_server_process_tests|region_recovery_tests|region_ops_tests|region_clone_tests|region_migration_tests|region_store_tests|region_load_tests|region_upgrade_tests|region_session_tests|grant_broker_tests|region_m10_session_tests|region_handoff_process_tests|fixtures/postgres_relay)\.cpp'
postgres_tools='migrations/|tools/prepare-postgres\.sh|tools/migrate-postgres\.sh|tools/backup/|tools/ci/postgres-check\.sh|tools/ci/life-reservations-|tools/ci/backup-check\.sh|tools/ci/dr-check\.sh|tools/ci/upgrade-check\.sh'
case "$suite" in
client)
pattern="$common|$native|tests/client_lifecycle\.cpp|experiments/(client|ui)/|tools/(prepare-imgui|imgui-pin)\.cmake|tools/prepare-sdl3\\.cmake|tools/sdl3-pin\\.cmake|deploy/docker/Dockerfile"
;;
network)
pattern="$common|$native|tests/network_|tests/fuzz/dev_session|third_party/mbedtls/|tools/prepare-mbedtls\.cmake|tools/mbedtls-pin\.cmake|deploy/docker/Dockerfile"
;;
checks|tsan|ecs)
pattern="$common|$native|tests/|experiments/|tools/ci/linux-check\.sh|tools/ci/tsan-profile\.mjs|deploy/docker/Dockerfile"
files=$(grep -Ev "^($postgres_only_tests)$" <<< "$files" || true)
;;
postgres|postgres-tools)
pattern="$common|$native|tests/|$postgres_tools|third_party/mbedtls/|tools/prepare-mbedtls\.cmake|tools/mbedtls-pin\.cmake|deploy/docker/Dockerfile"
;;
deploy)
pattern="$common|deploy/|tools/ops/|tools/backup/|tools/ci/deploy-policy-(check|selftest)\.py|tools/ci/prepare-kustomize\.sh|tools/ci/monitoring-check\.sh|tools/ci/ops-lib-check\.sh"
;;
server-image)
# Session-control, cellular lifecycle/publication and migration integration
# tests exercise the server image's runtime and schema-bootstrap boundaries.
pattern="$common|$native|tests/network_control\.cpp|tests/cellular_(session_batch|lives|publication)_tests\.cpp|tests/(region_migration|region_ops)_tests\.cpp|migrations/|tools/prepare-postgres\.sh|tools/ci/server-image-smoke\.sh|deploy/docker/Dockerfile"
;;
image)
pattern="$common|$native|tests/|deploy/docker/Dockerfile"
;;
*)
exit 0
;;
esac
grep -Eq "^($pattern)" <<< "$files"