diff --git a/.drone.yml b/.drone.yml index 5ef389b..d25884a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,7 @@ steps: - name: unit tests shell: powershell commands: - - ./tools/ci/steps/amd64/msvc/unit-tests.ps1 + - ./tools/ci/amd64/msvc/unit-tests.ps1 --- kind: pipeline @@ -28,13 +28,13 @@ steps: image: unit_tests:latest pull: if-not-exists commands: - - ./tools/ci/steps/amd64/gcc/unit-tests.sh + - ./tools/ci/amd64/gcc/unit-tests.sh - name: valgrind image: valgrind:latest pull: if-not-exists commands: - - ./tools/ci/steps/amd64/gcc/valgrind.sh + - ./tools/ci/amd64/gcc/valgrind.sh --- kind: pipeline @@ -49,13 +49,13 @@ steps: image: leak_sanitizer:latest pull: if-not-exists commands: - - ./tools/ci/steps/amd64/clang/lsan.sh + - ./tools/ci/amd64/clang/lsan.sh - name: memory sanitizer image: memory_sanitizer:latest pull: if-not-exists commands: - - ./tools/ci/steps/amd64/clang/msan.sh + - ./tools/ci/amd64/clang/msan.sh --- kind: pipeline @@ -66,24 +66,15 @@ trigger: - main steps: -- name: static_analysis - image: static_analysis:latest +- name: clang tidy + image: clang_tidy:latest pull: if-not-exists privileged: true commands: - - ./tools/ci/steps/static_analysis.sh + - ./tools/ci/static_analysis/clang_tidy.sh ---- -kind: pipeline -type: docker -name: style -trigger: - branch: - - main - -steps: - name: clang format image: clang_format:latest pull: if-not-exists commands: - - ./tools/ci/steps/style.sh + - ./tools/ci/static_analysis/clang_format.sh diff --git a/tools/ci/amd64/clang/coverage.sh b/tools/ci/amd64/clang/coverage.sh new file mode 100755 index 0000000..6a03ffe --- /dev/null +++ b/tools/ci/amd64/clang/coverage.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e +cd $(git rev-parse --show-toplevel)/ +rm -rf ./build + +conan build . \ + -c tools.system.package_manager:mode=install \ + -c tools.cmake.cmaketoolchain:generator=Ninja \ + -c tools.build:cxxflags='["-fprofile-instr-generate", "-fcoverage-mapping"]' \ + -c tools.build:sharedlinkflags='["-fprofile-instr-generate", "-fcoverage-mapping"]' \ + -c tools.build:exelinkflags='["-fprofile-instr-generate", "-fcoverage-mapping"]' \ + -c tools.info.package_id:confs='["tools.build:cxxflags","tools.build:sharedlinkflags","tools.build:exelinkflags"]' \ + -c tools.build:compiler_executables='{"c": "clang", "cpp": "clang++"}' \ + -s build_type=Release \ + -s compiler=clang \ + -s compiler.version=20 \ + -s compiler.libcxx=libc++ \ + -o use_mold=True \ + --build=missing + +for test in $(find ./build -type f -name '*_tests' -executable); do + echo "Running $test" + "$test" +done + diff --git a/tools/ci/images/leak_sanitizer/Dockerfile b/tools/ci/amd64/clang/lsan.dockerfile similarity index 100% rename from tools/ci/images/leak_sanitizer/Dockerfile rename to tools/ci/amd64/clang/lsan.dockerfile diff --git a/tools/ci/steps/amd64/clang/lsan.sh b/tools/ci/amd64/clang/lsan.sh similarity index 100% rename from tools/ci/steps/amd64/clang/lsan.sh rename to tools/ci/amd64/clang/lsan.sh diff --git a/tools/ci/images/memory_sanitizer/Dockerfile b/tools/ci/amd64/clang/msan.dockerfile similarity index 100% rename from tools/ci/images/memory_sanitizer/Dockerfile rename to tools/ci/amd64/clang/msan.dockerfile diff --git a/tools/ci/steps/amd64/clang/msan.sh b/tools/ci/amd64/clang/msan.sh similarity index 100% rename from tools/ci/steps/amd64/clang/msan.sh rename to tools/ci/amd64/clang/msan.sh diff --git a/tools/ci/images/unit_tests/Dockerfile b/tools/ci/amd64/gcc/unit_tests.dockerfile similarity index 100% rename from tools/ci/images/unit_tests/Dockerfile rename to tools/ci/amd64/gcc/unit_tests.dockerfile diff --git a/tools/ci/steps/amd64/gcc/unit-tests.sh b/tools/ci/amd64/gcc/unit_tests.sh similarity index 100% rename from tools/ci/steps/amd64/gcc/unit-tests.sh rename to tools/ci/amd64/gcc/unit_tests.sh diff --git a/tools/ci/images/valgrind/Dockerfile b/tools/ci/amd64/gcc/valgrind.dockerfile similarity index 100% rename from tools/ci/images/valgrind/Dockerfile rename to tools/ci/amd64/gcc/valgrind.dockerfile diff --git a/tools/ci/steps/amd64/gcc/valgrind.sh b/tools/ci/amd64/gcc/valgrind.sh similarity index 100% rename from tools/ci/steps/amd64/gcc/valgrind.sh rename to tools/ci/amd64/gcc/valgrind.sh diff --git a/tools/ci/steps/amd64/msvc/unit-tests.ps1 b/tools/ci/amd64/msvc/unit_tests.ps1 similarity index 100% rename from tools/ci/steps/amd64/msvc/unit-tests.ps1 rename to tools/ci/amd64/msvc/unit_tests.ps1 diff --git a/tools/ci/images/clang_format/Dockerfile b/tools/ci/static_analysis/clang_format.dockerfile similarity index 100% rename from tools/ci/images/clang_format/Dockerfile rename to tools/ci/static_analysis/clang_format.dockerfile diff --git a/tools/ci/steps/style.sh b/tools/ci/static_analysis/clang_format.sh similarity index 100% rename from tools/ci/steps/style.sh rename to tools/ci/static_analysis/clang_format.sh diff --git a/tools/ci/images/static_analysis/Dockerfile b/tools/ci/static_analysis/clang_tidy.dockerfile similarity index 100% rename from tools/ci/images/static_analysis/Dockerfile rename to tools/ci/static_analysis/clang_tidy.dockerfile diff --git a/tools/ci/steps/static_analysis.sh b/tools/ci/static_analysis/clang_tidy.sh similarity index 100% rename from tools/ci/steps/static_analysis.sh rename to tools/ci/static_analysis/clang_tidy.sh diff --git a/tools/scripts/build_ci_images.sh b/tools/scripts/build_ci_images.sh index 289d879..488ff7f 100755 --- a/tools/scripts/build_ci_images.sh +++ b/tools/scripts/build_ci_images.sh @@ -1,30 +1,24 @@ #!/bin/bash set -e -IMAGE_DIR="$(git rev-parse --show-toplevel)/tools/ci/images" +CI_DIR="$(git rev-parse --show-toplevel)/tools/ci/" -echo "==> Building image: clang format" -cd "$IMAGE_DIR/clang_format" -docker build -t clang_format . +echo "==> Building image: clang_format" +docker build -t clang_format -f $CI_DIR/static_analysis/clang_format.dockerfile . -echo "==> Building image: static analysis" -cd "$IMAGE_DIR/static_analysis" -docker build -t static_analysis . +echo "==> Building image: static_analysis" +docker build -t clang_tidy -f $CI_DIR/static_analysis/clang_tidy.dockerfile . -echo "==> Building image: unit tests" -cd "$IMAGE_DIR/unit_tests" -docker build -t unit_tests . +echo "==> Building image: amd64_gcc_unit_tests" +docker build -t amd64_gcc_unit_tests -f $CI_DIR/amd64/gcc/unit_tests.dockerfile . -echo "==> Building image: valgrind" -cd "$IMAGE_DIR/valgrind" -docker build -t valgrind . +echo "==> Building image: amd64_gcc_valgrind" +docker build -t amd64_gcc_valgrind -f $CI_DIR/amd64/gcc/valgrind.dockerfile . -echo "==> Building image: leak_sanitizer" -cd "$IMAGE_DIR/leak_sanitizer" -docker build -t leak_sanitizer . +echo "==> Building image: amd64_clang_lsan" +docker build -t amd64_clang_lsan -f $CI_DIR/amd64/clang/lsan.dockerfile . -echo "==> Building image: memory_sanitizer" -cd "$IMAGE_DIR/memory_sanitizer" -docker build -t memory_sanitizer . +echo "==> Building image: amd64_clang_lsan" +docker build -t amd64_clang_lsan -f $CI_DIR/amd64/clang/lsan.dockerfile . echo "WOOOOOOOOOOOOOOOOH!!! DONE :D"