ci: cache and narrow foundation builds
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
suite=${1:?suite required}
|
||||
base=${GITHUB_EVENT_BEFORE:-}
|
||||
if [[ -z "$base" || "$base" == 0000000000000000000000000000000000000000 ]]; then
|
||||
base=HEAD^
|
||||
fi
|
||||
|
||||
# A single-parent diff is sufficient for push and the merge commit generated for
|
||||
# pull requests. If history is unavailable, fail open and run the gate.
|
||||
if ! files=$(git diff --name-only "$base" HEAD 2>/dev/null); then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$suite" in
|
||||
checks|tsan|ecs)
|
||||
grep -Eq '^(CMakeLists.txt|CMakePresets.txt|CMakePresets.json|cmake/|include/|src/|apps/|tests/|experiments/|tools/ci/linux-check.sh|tools/ci/tsan-profile.mjs|deploy/docker/Dockerfile|\.gitea/workflows/)' <<<"$files"
|
||||
;;
|
||||
postgres|postgres-tools)
|
||||
grep -Eq '^(CMakeLists.txt|CMakePresets.json|cmake/|include/|src/|apps/|tests/|migrations/|tools/prepare-postgres.sh|tools/ci/postgres-check.sh|tools/migrate-postgres.sh|deploy/docker/Dockerfile|\.gitea/workflows/)' <<<"$files"
|
||||
;;
|
||||
deploy)
|
||||
grep -Eq '^(deploy/|tools/ci/deploy-policy-check.py|\.gitea/workflows/)' <<<"$files"
|
||||
;;
|
||||
server-image)
|
||||
grep -Eq '^(CMakeLists.txt|CMakePresets.json|cmake/|include/|src/|apps/|migrations/|tools/prepare-postgres.sh|tools/ci/server-image-smoke.sh|deploy/docker/Dockerfile|\.gitea/workflows/)' <<<"$files"
|
||||
;;
|
||||
image)
|
||||
grep -Eq '^(CMakeLists.txt|CMakePresets.json|cmake/|include/|src/|apps/|tests/|deploy/docker/Dockerfile|\.gitea/workflows/)' <<<"$files"
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user