ci: run a pedantic build as part of the GitHub workflow
similar to the recently added sparse task, it is nice to know as early as possible. add a dockerized build using fedora (that usually has the latest gcc) to be ahead of the curve and avoid older ISO C issues at the same time. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Carlo Marcelo Arenas Belón committed
Aug 8, 2021 at 18:38 UTC
cebead1ebfb8f6c78097173749596cb9604776d9
3 files changed
+13
-3
.github/workflows/main.yml
+2
@@ -324,6 +324,8 @@ jobs:
324
image: alpine
325
- jobname: Linux32
326
image: daald/ubuntu32:xenial
327
+ - jobname: pedantic
328
+ image: fedora
329
env:
330
jobname: ${{matrix.vector.jobname}}
331
runs-on: ubuntu-latest
ci/install-docker-dependencies.sh
+4
@@ -15,4 +15,8 @@ linux-musl)
15
apk add --update build-base curl-dev openssl-dev expat-dev gettext \
16
pcre2-dev python3 musl-libintl perl-utils ncurses >/dev/null
17
;;
18
+pedantic)
19
+ dnf -yq update >/dev/null &&
20
+ dnf -yq install make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
21
+ ;;
22
esac
ci/run-build-and-tests.sh
+7
-3
@@ -10,6 +10,11 @@ windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";;
10
*) ln -s "$cache_dir/.prove" t/.prove;;
11
esac
12
13
+if test "$jobname" = "pedantic"
14
+then
15
+ export DEVOPTS=pedantic
16
+fi
17
+
18
make
19
case "$jobname" in
20
linux-gcc)
@@ -35,10 +40,9 @@ linux-clang)
40
export GIT_TEST_DEFAULT_HASH=sha256
41
make test
42
;;
38
-linux-gcc-4.8)
43
+linux-gcc-4.8|pedantic)
44
# Don't run the tests; we only care about whether Git can be
40
- # built with GCC 4.8, as it errors out on some undesired (C99)
41
- # constructs that newer compilers seem to quietly accept.
45
+ # built with GCC 4.8 or with pedantic
46
;;
47
*)
48
make test