Skip to content
Snippets Groups Projects
Commit 7e2fb305 authored by kongr45gpen's avatar kongr45gpen
Browse files

Improvements on CI

- Used a docker image with a more recent version of Debian
- Enabled colours for gcc and clang
- Updated clang-tidy from 4.0 to 7.0
- Enabled some diagnostic checks for clang-tidy, and disabled others that gave false positives
- Made clang-tidy read system header files, while ignoring their errors
parent 346890c9
No related branches found
No related tags found
No related merge requests found
image: rikorose/gcc-cmake image: lycantropos/cmake
stages: stages:
- build - build
...@@ -6,16 +6,19 @@ stages: ...@@ -6,16 +6,19 @@ stages:
before_script: before_script:
- g++ --version - g++ --version
- cat /etc/*-release
build: build:
stage: build stage: build
variables: variables:
GIT_SUBMODULE_STRATEGY: normal GIT_SUBMODULE_STRATEGY: normal
GCC_COLORS: "error=31;1:warning=35;1:note=36;1:range1=32:range2=34:locus=39;1:quote=39;1:fixit-insert=32:fixit-delete=31:diff-filename=39;1:diff-hunk=32:diff-delete=31:diff-insert=32:type-diff=32;1"
CLICOLOR_FORCE: 1
script: script:
- cmake . -DCMAKE_CXX_FLAGS="-Werror" - cmake . -DCMAKE_CXX_FLAGS="-Werror -fdiagnostics-color=always"
- make -j4 - make -j4
- make clean - make clean
- cmake . -DCMAKE_CXX_FLAGS="-Wall -Wextra" # Build again, but with more warnings - cmake . -DCMAKE_CXX_FLAGS="-Wall -Wextra -fdiagnostics-color=always" # Build again, but with more warnings
- make -j4 - make -j4
tests: tests:
...@@ -38,7 +41,7 @@ cppcheck: ...@@ -38,7 +41,7 @@ cppcheck:
- apt-get update -qq && apt-get install -y -qq cppcheck - apt-get update -qq && apt-get install -y -qq cppcheck
- cppcheck --version - cppcheck --version
script: script:
- bash -x ci/cppcheck.sh - ci/cppcheck.sh
vera: vera:
stage: build stage: build
...@@ -47,12 +50,16 @@ vera: ...@@ -47,12 +50,16 @@ vera:
- vera++ --version - vera++ --version
- cp ci/vera.profile /usr/lib/vera++/profiles/custom - cp ci/vera.profile /usr/lib/vera++/profiles/custom
script: script:
- bash -x ci/vera.sh - ci/vera.sh
clang-tidy: clang-tidy:
stage: build stage: build
variables:
GIT_SUBMODULE_STRATEGY: normal
TERM: xterm-color
before_script: before_script:
- apt-get update -qq && apt-get install -y -qq clang-tidy-4.0 - echo deb http://deb.debian.org/debian sid main > /etc/apt/sources.list
- clang-tidy-4.0 --version - apt-get update -qq && apt-get -t sid install -y -qq clang-tidy-7
- clang-tidy-7 --version
script: script:
- bash -x ci/clang-tidy.sh - script -c "bash -x ci/clang-tidy.sh"
--- ---
Checks: > Checks: >
clang-diagnostic-*, -clang-diagnostic-error,
clang-analyzer-*, clang-analyzer-*,
bugprone-*, bugprone-*,
cppcoreguidelines-*,-cppcoreguidelines-no-malloc,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-bounds-constant-array-index, cert-*,
cppcoreguidelines-*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-bounds-constant-array-index,
misc-*,-misc-non-private-member-variables-in-classes, misc-*,-misc-non-private-member-variables-in-classes,
fuchsia-multiple-inheritance, fuchsia-multiple-inheritance,
google-*,-google-readability-todo, google-*,-google-readability-todo,
...@@ -17,8 +18,9 @@ Checks: > ...@@ -17,8 +18,9 @@ Checks: >
-misc-non-private-member-variables-in-classes, -misc-non-private-member-variables-in-classes,
performance-*, performance-*,
readability-*, readability-*,
WarningsAsErrors: '*,-misc-unused-parameters,-llvm-header-guard,-cppcoreguidelines-pro-type-member-init,-google-runtime-references,-clang-diagnostic-tautological-constant-out-of-range-compare,-readability-redundant-declaration' zircon-*
HeaderFilterRegex: '.*' WarningsAsErrors: '*,-misc-unused-parameters,-llvm-header-guard,-cppcoreguidelines-pro-type-member-init,-google-runtime-references,-clang-diagnostic-tautological-constant-out-of-range-compare,-readability-redundant-declaration,-modernize-use-equals-default,-fuchsia-statically-constructed-objects,-hicpp-signed-bitwise,-cert-err58-cpp'
HeaderFilterRegex: 'ecss-services\/((?!lib\/).)*$'
AnalyzeTemporaryDtors: false AnalyzeTemporaryDtors: false
... ...
...@@ -10,5 +10,6 @@ ...@@ -10,5 +10,6 @@
echo -e "\033[0;34mRunning clang-tidy...\033[0m" echo -e "\033[0;34mRunning clang-tidy...\033[0m"
cd "$(dirname "$0")" cd "$(dirname "$0")"
clang-tidy-4.0 `find ../src/ -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'` \ clang-tidy-7 `find ../src/ -type f -regextype posix-egrep -regex '.*\.(cpp|hpp|c|h)'` \
-extra-arg=-fcolor-diagnostics -- -std=c++14 -I../inc -extra-arg=-fcolor-diagnostics -- -std=c++17 -I../inc \
-I/usr/include/c++/7/ -I/usr/include/x86_64-linux-gnu/c++/7 -I../lib/etl/include
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