From 3d80b7e02a6c17dac8951cc6474e0856db3bb802 Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Wed, 19 Jul 2023 11:31:59 +0200 Subject: [PATCH 1/4] build: only fetch doctest if it is not present yet --- test/CMakeLists.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1096dd3..ed46443 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,17 +1,20 @@ -include(FetchContent) +find_library(DOCTEST_LIB doctest) -FetchContent_Declare( +if(NOT DOCTEST_LIB) + include(FetchContent) + + FetchContent_Declare( DocTest GIT_REPOSITORY https://github.com/doctest/doctest.git - GIT_TAG v2.4.9 -) + GIT_TAG v2.4.9) -FetchContent_MakeAvailable(DocTest) + FetchContent_MakeAvailable(DocTest) +endif() add_executable(testTug setup.cpp testBoundaryCondition.cpp testDiffusion.cpp) target_link_libraries(testTug doctest tug) -add_custom_target(check - COMMAND $ - DEPENDS testTug -) +add_custom_target( + check + COMMAND $ + DEPENDS testTug) From 5bee2d20e96e82494de23a5f4783f2d15dd4d785 Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Wed, 19 Jul 2023 11:39:03 +0200 Subject: [PATCH 2/4] ci: use reworked docker image for ci --- .gitlab-ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 205a2e3..d45d739 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: sobc/gitlab-ci +image: git.gfz-potsdam.de:5000/naaice/tug:ci stages: - build @@ -6,8 +6,6 @@ stages: - static_analyze build_release: - before_script: - - apt-get update && apt-get install -y libeigen3-dev git stage: build artifacts: paths: @@ -24,9 +22,9 @@ test: - ./build/test/testTug lint: - before_script: - - apt-get update && apt-get install -y libeigen3-dev stage: static_analyze + before_script: + - apk add clang-extra-tools script: - mkdir lint && cd lint - cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-checks=cppcoreguidelines-*,clang-analyzer-*,performance-*,readability-*, modernize-*" -DTUG_ENABLE_TESTING=OFF .. From 7e4dc1e383cdb54f07ba2f54525eb670a37ef713 Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Wed, 19 Jul 2023 11:59:35 +0200 Subject: [PATCH 3/4] ci: provide dockerfile for image creation --- utils/ci.Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 utils/ci.Dockerfile diff --git a/utils/ci.Dockerfile b/utils/ci.Dockerfile new file mode 100644 index 0000000..30ddc7a --- /dev/null +++ b/utils/ci.Dockerfile @@ -0,0 +1,4 @@ +FROM alpine + MAINTAINER Max Luebke + +RUN apk add --no-cache build-base openmp cmake git eigen-dev From 54b9a31f16a8869b8f68ad887e63ea06f2ef4de4 Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Wed, 19 Jul 2023 12:07:37 +0200 Subject: [PATCH 4/4] ci: remove readability from SA checks --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d45d739..d9f4baf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,6 @@ lint: - apk add clang-extra-tools script: - mkdir lint && cd lint - - cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-checks=cppcoreguidelines-*,clang-analyzer-*,performance-*,readability-*, modernize-*" -DTUG_ENABLE_TESTING=OFF .. + - cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-checks=cppcoreguidelines-*,clang-analyzer-*,performance-*, modernize-*" -DTUG_ENABLE_TESTING=OFF .. - make tug when: manual