aboutsummaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-23 09:32:24 -0800
committerJunio C Hamano <gitster@pobox.com>2024-12-23 09:32:25 -0800
commit83c8f7623538e67262db18c98d9c1da6b50e289d (patch)
tree5e317bedaa760e01fda2f8fdd85d54a44f4ee79c /ci
parentMerge branch 'kl/doc-build-fix' (diff)
parentci: wire up Meson builds (diff)
downloadgit-83c8f7623538e67262db18c98d9c1da6b50e289d.tar.gz
git-83c8f7623538e67262db18c98d9c1da6b50e289d.zip
Merge branch 'ps/ci-meson'
The meson-build procedure is integrated into CI to catch and prevent bitrotting. * ps/ci-meson: ci: wire up Meson builds t: introduce compatibility options to clar-based tests t: fix out-of-tree tests for some git-p4 tests Makefile: detect missing Meson tests meson: detect missing tests at configure time t/unit-tests: rename clar-based unit tests to have a common prefix Makefile: drop -DSUPPRESS_ANNOTATED_LEAKS ci/lib: support custom output directories when creating test artifacts
Diffstat (limited to 'ci')
-rwxr-xr-xci/install-dependencies.sh7
-rwxr-xr-xci/lib.sh14
-rwxr-xr-xci/print-test-failures.sh2
-rwxr-xr-xci/run-build-and-tests.sh31
4 files changed, 39 insertions, 15 deletions
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index d020cb7aa5..d1cb9fa878 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -58,6 +58,7 @@ ubuntu-*|ubuntu32-*|debian-*)
make libssl-dev libcurl4-openssl-dev libexpat-dev wget sudo default-jre \
tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl \
libemail-valid-perl libio-pty-perl libio-socket-ssl-perl libnet-smtp-ssl-perl libdbd-sqlite3-perl libcgi-pm-perl \
+ libpcre2-dev meson ninja-build pkg-config \
${CC_PACKAGE:-${CC:-gcc}} $PYTHON_PACKAGE
case "$distro" in
@@ -90,6 +91,12 @@ macos-*)
sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
rm helix-core-server.tgz
+ case "$jobname" in
+ osx-meson)
+ brew install meson ninja pcre2
+ ;;
+ esac
+
if test -n "$CC_PACKAGE"
then
BREW_PACKAGE=${CC_PACKAGE/-/@}
diff --git a/ci/lib.sh b/ci/lib.sh
index 5440eb6dc0..8885ee3c3f 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -181,9 +181,9 @@ handle_failed_tests () {
}
create_failed_test_artifacts () {
- mkdir -p t/failed-test-artifacts
+ mkdir -p "${TEST_OUTPUT_DIRECTORY:-t}"/failed-test-artifacts
- for test_exit in t/test-results/*.exit
+ for test_exit in "${TEST_OUTPUT_DIRECTORY:-t}"/test-results/*.exit
do
test 0 != "$(cat "$test_exit")" || continue
@@ -192,11 +192,11 @@ create_failed_test_artifacts () {
printf "\\e[33m\\e[1m=== Failed test: ${test_name} ===\\e[m\\n"
echo "The full logs are in the 'print test failures' step below."
echo "See also the 'failed-tests-*' artifacts attached to this run."
- cat "t/test-results/$test_name.markup"
+ cat "${TEST_OUTPUT_DIRECTORY:-t}/test-results/$test_name.markup"
- trash_dir="t/trash directory.$test_name"
- cp "t/test-results/$test_name.out" t/failed-test-artifacts/
- tar czf t/failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
+ trash_dir="${TEST_OUTPUT_DIRECTORY:-t}/trash directory.$test_name"
+ cp "${TEST_OUTPUT_DIRECTORY:-t}/test-results/$test_name.out" "${TEST_OUTPUT_DIRECTORY:-t}"/failed-test-artifacts/
+ tar czf "${TEST_OUTPUT_DIRECTORY:-t}/failed-test-artifacts/$test_name.trash.tar.gz" "$trash_dir"
done
}
@@ -237,7 +237,7 @@ then
CC="${CC_PACKAGE:-${CC:-gcc}}"
DONT_SKIP_TAGS=t
handle_failed_tests () {
- echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
+ echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:-t}/failed-test-artifacts" >>$GITHUB_ENV
create_failed_test_artifacts
return 1
}
diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh
index b1f80aeac3..655687dd82 100755
--- a/ci/print-test-failures.sh
+++ b/ci/print-test-failures.sh
@@ -46,7 +46,7 @@ do
;;
github-actions)
mkdir -p failed-test-artifacts
- echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
+ echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:t}/failed-test-artifacts" >>$GITHUB_ENV
cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
continue
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 2e28d02b20..c4a41bba0b 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -48,12 +48,29 @@ pedantic)
;;
esac
-group Build make
-if test -n "$run_tests"
-then
- group "Run tests" make test ||
- handle_failed_tests
-fi
-check_unignored_build_artifacts
+case "$jobname" in
+*-meson)
+ group "Configure" meson setup build . \
+ --warnlevel 2 --werror \
+ --wrap-mode nofallback
+ group "Build" meson compile -C build --
+ if test -n "$run_tests"
+ then
+ group "Run tests" meson test -C build --print-errorlogs --test-args="$GIT_TEST_OPTS" || (
+ ./t/aggregate-results.sh "${TEST_OUTPUT_DIRECTORY:-t}/test-results"
+ handle_failed_tests
+ )
+ fi
+ ;;
+*)
+ group Build make
+ if test -n "$run_tests"
+ then
+ group "Run tests" make test ||
+ handle_failed_tests
+ fi
+ ;;
+esac
+check_unignored_build_artifacts
save_good_tree