Skip to content
Snippets Groups Projects
Commit 8ee39ae7 authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

CI: implement universal check for compiler warnings

parent 1d4a8589
No related branches found
No related tags found
1 merge request!28Build everything but the HL interface without warnings
......@@ -65,7 +65,7 @@ check_style:
--fortran .f90
- git -C ${CI_PROJECT_DIR} diff --patch-with-raw > ${STYLE_PATCH}
- |
# Test if patching is necessary:
# Test if patching is necessary
test ! -s ${STYLE_PATCH} || {
printf "${RED}The source code does not meet the style recuirements. \
Please, apply the patch (see artifacts).${DEFAULT}\n"
......@@ -115,6 +115,8 @@ include:
LIBCHECK_SHA256: a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a
MAKEFLAGS: --jobs=8 V=1
AM_COLOR_TESTS: always
WARNINGS_AWK_SCRIPT: '/warning/ || /WARNING/ || /Warning/'
WARNINGS_FILE: ${CI_PROJECT_DIR}/make.warnings
before_script:
- module purge
- module load gcc/11.2.0-gcc-11.2.0
......@@ -138,29 +140,31 @@ include:
script:
- mkdir build && cd build
- ../configure --with-check-root="${LIBCHEK_ROOT}" ${CONFIG_EXTRA_ARGS}
- make
- make check
- make --output-sync=target check AM_COLOR_TESTS=no TESTS= 2> >(tee ${WARNINGS_FILE})
- make --silent --keep-going check
- awk "${WARNINGS_AWK_SCRIPT}" ${WARNINGS_FILE} > awk.out
- |
# Check if there are compiler warnings
test ! -s awk.out || {
printf "${RED}The compiler issued warnings (see artifacts).${DEFAULT}\n"
exit 1
}
interruptible: true
artifacts:
when: on_failure
paths:
- ${WARNINGS_FILE}
cache:
policy: pull
key: ${LIBCHECK_SHA256}
paths:
- ${LIBCHEK_ROOT}
gcc11_pedantic:
extends: .common
script:
# The examples are too broken:
- ./configure --disable-examples ${CONFIG_EXTRA_ARGS}
# The configuration fails with all warnings enabled and -Werror. Therefore,
# we extend the flags at the build time:
- >-
make
CFLAGS="$(echo '@CFLAGS@' | ./config.status --file=-) -Wall -Wextra -pedantic -Werror"
FCFLAGS="$(echo '@FCFLAGS@' | ./config.status -q --file=-) -Wall -Wextra -pedantic -Werror"
gcc11:
extends: .common
variables:
CFLAGS: -g -O2 -Wall -Wextra -pedantic
FCFLAGS: -g -O2 -Wall -Wextra -pedantic
cache:
policy: pull-push
......@@ -187,6 +191,8 @@ nag:
extends: .common
variables:
FC: nagfor
# Ignore Questionable warnings:
WARNINGS_AWK_SCRIPT: '!/^\[NAG Fortran Compiler normal termination/ && (/warning/ || /WARNING/ || /Warning/)'
before_script:
- !reference [.common, before_script]
- module load nag/7.1-gcc-11.2.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment