diff --git a/.clang-tidy b/.clang-tidy index 92f8412..d28ed7a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -15,7 +15,6 @@ Checks: > -cppcoreguidelines-macro-usage, -cppcoreguidelines-avoid-do-while -HeaderFilterRegex: '^(Bigfoot)/' ExcludeHeaderFilterRegex: '_generated.*' CheckOptions: diff --git a/.gitea/workflows/sonarqube.yml b/.gitea/workflows/sonarqube.yml index f5612da..85d6c33 100644 --- a/.gitea/workflows/sonarqube.yml +++ b/.gitea/workflows/sonarqube.yml @@ -1,10 +1,8 @@ name: Bigfoot on: - push: - branches: - - '**' - workflow_dispatch: + push: [main] + pull_request: [main] jobs: build-and-test: @@ -25,14 +23,22 @@ jobs: - name: Generate run: | - conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang -pr:b=clang --build=missing -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True - cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_UNITY_BUILD=Debug -G "Ninja" + conan install . --deployer=full_deploy --deployer-folder=build --remote=bigfootpackages -pr:h=clang_coverage -pr:b=clang_coverage --build=missing -s build_type=Debug -o bigfoot/*:build_tests=True -o bigfoot/*:tracy=False -o bigfoot/*:build_tools=True -o bigfoot/*:vulkan=True -o bigfoot/*:build_benchmarks=True + cmake -S . -B ./build/Debug --toolchain ./build/Debug/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja" + cmake --build build/Debug --parallel $(nproc) - name: Clang-Tidy run: run-clang-tidy -p ./build/Debug/ >> tidy_result.txt + - name: Infer + run: infer run --compilation-database build/Debug/compile_commands.json + - name: SonarQube Scan uses: SonarSource/sonarqube-scan-action@v7.0.0 + with: + args: > + -Dsonar.cxx.jsonCompilationDatabase=./build/Debug/compile_commands.json + -Dsonar.verbose=true env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST }} \ No newline at end of file diff --git a/.inferconfig b/.inferconfig new file mode 100644 index 0000000..0e0dcd2 --- /dev/null +++ b/.inferconfig @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/CMake/Package.cmake b/CMake/Package.cmake index 8f46ecd..ed86db9 100644 --- a/CMake/Package.cmake +++ b/CMake/Package.cmake @@ -22,6 +22,8 @@ function(bigfoot_create_package_lib PackagePublicDependencies PackagePrivateDepe ${_BF_SOURCES} ) + target_compile_options(${PROJECT_NAME} PRIVATE ${BIGFOOT_CXX_FLAGS}) + target_link_libraries(${PROJECT_NAME} PUBLIC unordered_dense::unordered_dense EASTL::EASTL flatbuffers::flatbuffers rapidhash::rapidhash) target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS}) @@ -55,6 +57,9 @@ function(bigfoot_create_package_tests ParentFolder BigfootDependencies) ${_BF_TEST_SOURCES} ) + target_compile_options(${PROJECT_NAME} PRIVATE ${BIGFOOT_CXX_FLAGS}) + target_link_options(${PROJECT_NAME} PRIVATE ${BIGFOOT_EXE_LINK_FLAGS}) + target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include) target_link_libraries(${PROJECT_NAME} PRIVATE $) @@ -89,5 +94,4 @@ function(bigfoot_create_package_tests ParentFolder BigfootDependencies) add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}Fixture) set_target_properties(${PROJECT_NAME}Fixture PROPERTIES FOLDER UtilityTargets/Tests/Bigfoot/${ParentFolder}) - endfunction() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fd09f0..665a2ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.24) +# CMake sets this flag by default, we don't use exception in bigfoot, we can remove it string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") project(Bigfoot VERSION 0.1.0 diff --git a/sonar-project.properties b/sonar-project.properties index 9120d71..d2fc0e0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,5 +7,4 @@ sonar.sourceEncoding=UTF-8 sonar.sources=Bigfoot/Sources sonar.tests=Bigfoot/Tests -sonar.cxx.file.suffixes=.hpp,.cpp,.h -sonar.cxx.clangtidy.reportPaths=tidy_result.txt \ No newline at end of file +sonar.cxx.clangtidy.reportPaths=tidy_result \ No newline at end of file