Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	main/main.cpp
This commit is contained in:
Edgar Schkrob 2019-11-14 12:38:13 +01:00
commit 9bd85c5273
2 changed files with 100 additions and 0 deletions

32
.ci/clang-tidy.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/sh
echo "Doing clang-tidy..."
bool=false
# explicitly set IFS to contain only a line feed
IFS='
'
filelist="$(find . -not \( -path './*build*' -prune \) -type f ! -name "$(printf "*\n*")")"
for file in $filelist; do
if echo "$file" | grep -q -E ".*(\.cpp|\.h|\.hpp)$" ; then
#Extra check missing dependencies due to clang-tidy doesn't toggle exit code.
clang_tidy_lib_check="$(clang-tidy -warnings-as-errors='*' -header-filter='.*,-cpptoml.hpp' -checks='*,-llvm-header-guard,-fuchsia-statically-constructed-objects,-fuchsia-default-arguments,-fuchsia-default-arguments-calls,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-constant-array-index,-bugprone-narrowing-conversions,-cppcoreguidelines-narrowing-conversions,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-hicpp-signed-bitwise,-bugprone-exception-escape,-cppcoreguidelines-pro-type-member-init,-cppcoreguidelines-pro-type-cstyle-cast,-hicpp-member-init' "$file" -- -I. -std=c++14 2>&1)"
for tidy_line in $clang_tidy_lib_check; do
echo "$tidy_line" | grep -q -v -E "^Error while processing*"
if [ $? -eq 1 ]; then
bool=true
fi
echo "$tidy_line" | grep -q -v -E ".* error: .*"
if [ $? -eq 1 ]; then
bool=true
fi
echo "$tidy_line"
done
fi
done
if $bool; then
exit 1
else
echo "No clang-tidy errors found."
fi
exit 0

68
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,68 @@
---
image: samueldebruyn/debian-git:latest
stages:
- style
- test
- build
clang_tidy:
image: joethei/clang_tidy
stage: style
tags:
- docker-ci
script:
- sh .ci/clang-tidy.sh;
make_test:
stage: test
tags:
- docker-ci
script:
- apt-get update
- apt-get install -y g++ make cmake clang-tidy libfltk1.3 libfltk1.3-dev
- mkdir current
- ls | grep -v current | xargs mv -t current
- git clone https://github.com/catchorg/Catch2.git
- cd Catch2
- cmake -Bbuild -H. -DBUILD_TESTING=OFF
- cmake --build build/ --target install
- cd ..
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.repo.digitech.hs-emden-leer.de/link/projekte/ws19/vkvm-new/library.git
- mkdir library/build
- cd library/build
- cmake ..
- make
- cd ../../current
- mkdir build
- cd build
- cmake ..
- make
- make test
cmake_build:
stage: build
tags:
- docker-ci
script:
- apt-get update
- apt-get install -y g++ make cmake clang-tidy libfltk1.3 libfltk1.3-dev
- mkdir current
- ls | grep -v current | xargs mv -t current
- git clone https://github.com/catchorg/Catch2.git
- cd Catch2
- cmake -Bbuild -H. -DBUILD_TESTING=OFF
- cmake --build build/ --target install
- cd ..
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.repo.digitech.hs-emden-leer.de/link/projekte/ws19/vkvm-new/library.git
- mkdir library/build
- cd library/build
- cmake ..
- make
- cd ../../current
- mkdir build
- cd build
- cmake ..
- make