ci: convert "pedantic" job into full build with breaking changes

The "pedantic" CI job is building on Fedora with `DEVOPTS=pedantic`.
This build flag doesn't do anything anymore starting with 6a8cbc41ba
(developer: enable pedantic by default, 2021-09-03), where we have
flipped the default so that developers have to opt-out of pedantic
builds via the "no-pedantic" option. As such, all this job really does
is to do a normal build on Fedora, which isn't all that interesting.

Convert that job into a full build-and-test job that uses Meson with
breaking changes enabled. This plugs two gaps:

  - We now test on another distro that we didn't run tests on
    beforehand.

  - We verify that breaking changes work as expected with Meson.

Furthermore, in a subsequent commit we'll modify both jobs that use
breaking changes to also enable Rust. By converting the Fedora job to
use Meson, we ensure that we test our Rust build infrastructure for both
build systems.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
next
Patrick Steinhardt 2025-10-02 09:29:33 +02:00 committed by Junio C Hamano
parent 8f5daaff92
commit 6ab3977200
4 changed files with 17 additions and 26 deletions

View File

@ -379,6 +379,8 @@ jobs:
- jobname: linux-breaking-changes
cc: gcc
image: ubuntu:rolling
- jobname: fedora-breaking-changes-meson
image: fedora:latest
- jobname: linux-leaks
image: ubuntu:rolling
cc: gcc
@ -396,8 +398,6 @@ jobs:
# Supported until 2025-04-02.
- jobname: linux32
image: i386/ubuntu:focal
- jobname: pedantic
image: fedora:latest
# A RHEL 8 compatible distro. Supported until 2029-05-31.
- jobname: almalinux-8
image: almalinux:8

View File

@ -45,6 +45,8 @@ test:linux:
- jobname: linux-breaking-changes
image: ubuntu:20.04
CC: gcc
- jobname: fedora-breaking-changes-meson
image: fedora:latest
- jobname: linux-TEST-vars
image: ubuntu:20.04
CC: gcc
@ -58,8 +60,6 @@ test:linux:
- jobname: linux-asan-ubsan
image: ubuntu:rolling
CC: clang
- jobname: pedantic
image: fedora:latest
- jobname: linux-musl-meson
image: alpine:latest
- jobname: linux32

View File

@ -30,8 +30,12 @@ alpine-*)
bash cvs gnupg perl-cgi perl-dbd-sqlite perl-io-tty >/dev/null
;;
fedora-*|almalinux-*)
case "$jobname" in
*-meson)
MESON_DEPS="meson ninja";;
esac
dnf -yq update >/dev/null &&
dnf -yq install shadow-utils sudo make gcc findutils diffutils perl python3 gawk gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
dnf -yq install shadow-utils sudo make pkg-config gcc findutils diffutils perl python3 gawk gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel $MESON_DEPS >/dev/null
;;
ubuntu-*|i386/ubuntu-*|debian-*)
# Required so that apt doesn't wait for user input on certain packages.

View File

@ -5,12 +5,11 @@

. ${0%/*}/lib.sh

run_tests=t

case "$jobname" in
linux-breaking-changes)
fedora-breaking-changes-musl|linux-breaking-changes)
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export WITH_BREAKING_CHANGES=YesPlease
MESONFLAGS="$MESONFLAGS -Dbreaking_changes=true"
;;
linux-TEST-vars)
export OPENSSL_SHA1_UNSAFE=YesPlease
@ -36,12 +35,6 @@ linux-sha256)
linux-reftable|linux-reftable-leaks|osx-reftable)
export GIT_TEST_DEFAULT_REF_FORMAT=reftable
;;
pedantic)
# Don't run the tests; we only care about whether Git can be
# built.
export DEVOPTS=pedantic
run_tests=
;;
esac

case "$jobname" in
@ -54,21 +47,15 @@ case "$jobname" in
-Dtest_output_directory="${TEST_OUTPUT_DIRECTORY:-$(pwd)/t}" \
$MESONFLAGS
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 "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
)
;;
*)
group Build make
if test -n "$run_tests"
then
group "Run tests" make test ||
handle_failed_tests
fi
group "Run tests" make test ||
handle_failed_tests
;;
esac