Skip to content
Snippets Groups Projects
Commit bfbf3963 authored by Lars Bilke's avatar Lars Bilke
Browse files

[ci] Fix warnings check.

Do the check right in the compiler job.
parent 4fa16eaf
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,6 @@ include:
- local: '/scripts/ci/jobs/build-docs.yml'
- local: '/scripts/ci/jobs/build-win.yml'
- local: '/scripts/ci/jobs/build-mac.yml'
- local: '/scripts/ci/jobs/checks.yml'
# - template: 'Code-Quality.gitlab-ci.yml' # see !3053
- local: '/scripts/ci/jobs/code-quality.yml'
- local: '/scripts/ci/jobs/code-coverage.yml'
......
......@@ -29,3 +29,7 @@
else
$BUILD_CMD_PREFIX cmake --build . --target ${TARGETS} > >(tee make.output)
fi
- |
if [[ "$CHECK_WARNINGS" = true ]] ; then
if [[ $(cat make.output | grep warning -i) ]]; then printf 'There were compiler warnings:\n\n'; cat make.output | grep warning -i; exit 1; fi
fi
......@@ -25,3 +25,10 @@
- if($env:BUILD_TESTS -eq "true") { cmake --build . --target tests }
- if($env:BUILD_CTEST -eq "true") { cmake --build . --target ctest }
- if($env:BUILD_CTEST -eq "true") { cp Testing/**/Test.xml Tests/ctest.xml }
- |
if($env:CHECK_WARNINGS -eq "true" -and (cat make.output | Select-String -Pattern ': warning') )
{
Write-Output 'There were compiler warnings:\n'
cat make.output | Select-String -Pattern ': warning'
exit 1
}
......@@ -50,6 +50,7 @@ build linux (no unity):
BUILD_DIR: "no-unity"
BUILD_TESTS: "false"
BUILD_CTEST: "false"
CHECK_WARNINGS: "true"
CMAKE_PRESET: release
CMAKE_ARGS: >-
-DOGS_USE_PYTHON=OFF
......
......@@ -7,6 +7,7 @@ build mac:
needs: [meta]
variables:
BUILD_DIR: "mac-release"
CHECK_WARNINGS: "true"
CMAKE_PRESET: release
CMAKE_ARGS: >-
-DOGS_INSTALL_DEPENDENCIES=ON
......
......@@ -8,6 +8,7 @@ build win:
allow_failure: true
variables:
BUILD_DIR: win-release
CHECK_WARNINGS: "true"
CMAKE_PRESET: release
CMAKE_ARGS: >-
-DOGS_CI_TESTRUNNER_REPEAT=1
......
compiler warnings:
stage: check
image: ubuntu:20.04
variables:
GIT_STRATEGY: none
allow_failure: true
needs:
- job: "build linux (no unity)"
- job: "build win: [USE_PYTHON=ON]"
- job: build mac
script:
- exit_code=0
- "if [[ $(cat build/no-unity/make.output | grep warning -i) ]]; then printf 'There were GCC compiler warnings:\n\n'; cat make.output | grep warning -i; exit_code=1; fi"
- "if [[ $(cat build/win-release/make.output | grep ': warning' -i) ]]; then printf 'There were MSVC compiler warnings:\n\n'; cat make.output | grep ': warning' -i; exit_code=1; fi"
- "if [[ $(cat build/mac-release/make.output | grep warning -i) ]]; then printf 'There were Clang (macOS) compiler warnings:\n\n'; cat make.output | grep warning -i; exit_code=1; fi"
- exit $exit_code
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