From ad54a1fa8ad355fc6bd4b0f7f35673473211e599 Mon Sep 17 00:00:00 2001 From: "Meng, Hengyu" Date: Tue, 20 Feb 2024 19:04:04 +0800 Subject: [PATCH] fix clang-tidy issues (#123) * refine ci conditions & ignore CMakeUserPresets.json --------- Co-authored-by: Ding, Yi1 --- .github/workflows/cpp-graph-test.yml | 3 +++ .github/workflows/format_scan.yml | 1 + .github/workflows/scripts/formatScan/clangtidy.sh | 2 +- .github/workflows/unit-test-llmruntime.yml | 3 +++ .gitignore | 1 + CMakeLists.txt | 2 +- 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-graph-test.yml b/.github/workflows/cpp-graph-test.yml index 7bd0b2940..a87b5aa34 100644 --- a/.github/workflows/cpp-graph-test.yml +++ b/.github/workflows/cpp-graph-test.yml @@ -8,6 +8,9 @@ on: - '.github/workflows/scripts/models/cpp_graph_inference.sh' - 'neural_speed/**' - 'bestla/**' + - 'CMakeLists.txt' + - 'setup.py' + - '!**/*.md' workflow_dispatch: inputs: compiler_version: diff --git a/.github/workflows/format_scan.yml b/.github/workflows/format_scan.yml index 4297bedfd..030537ab6 100644 --- a/.github/workflows/format_scan.yml +++ b/.github/workflows/format_scan.yml @@ -7,6 +7,7 @@ on: - neural_speed/** - bestla/** - scripts/** + - clang-format.py - setup.py - .github/workflows/format_scan.yml - .github/workflows/scripts/formatScan/** diff --git a/.github/workflows/scripts/formatScan/clangtidy.sh b/.github/workflows/scripts/formatScan/clangtidy.sh index 44e3503b3..a3795d6fc 100644 --- a/.github/workflows/scripts/formatScan/clangtidy.sh +++ b/.github/workflows/scripts/formatScan/clangtidy.sh @@ -14,7 +14,7 @@ cd build cmake .. -G Ninja -DNS_USE_CLANG_TIDY=CHECK -DBTLA_USE_OPENMP=OFF ninja 2>&1 | tee ${log_path} -if [[ ! -f ${log_path} ]] || [[ $(grep -c "warning:" ${log_path}) != 0 ]]; then +if [[ ! -f ${log_path} ]] || [[ $(grep -c "warning:" ${log_path}) != 0 ]] || [[ $(grep -c "error" ${log_path}) != 0 ]]; then exit 1 fi $BOLD_PURPLE && echo "Congratulations, check passed!" && $LIGHT_PURPLE && echo "You can click on the artifact button to see the log details." && $RESET diff --git a/.github/workflows/unit-test-llmruntime.yml b/.github/workflows/unit-test-llmruntime.yml index e5d0e0b6b..41e2791f4 100644 --- a/.github/workflows/unit-test-llmruntime.yml +++ b/.github/workflows/unit-test-llmruntime.yml @@ -8,6 +8,9 @@ on: - tests/** - .github/workflows/unit-test-llmruntime.yml - .github/workflows/unitTest/** + - 'CMakeLists.txt' + - 'setup.py' + - '!**/*.md' workflow_dispatch: # If there is a new commit, the previous jobs will be canceled diff --git a/.gitignore b/.gitignore index 258f58aa0..327c196a5 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ debug/ dist/ .cache/ .clangd +CMakeUserPresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 834df6e8d..679295549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,7 +139,7 @@ if (NS_BTLA_UT) endif() include(FindOpenMP) -set(BTLA_USE_OPENMP ON CACHE BOOL "BesTLA use OpenMP" FORCE) +set(BTLA_USE_OPENMP ON CACHE BOOL "BesTLA use OpenMP") add_subdirectory(bestla) add_subdirectory(neural_speed)