This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new c804024e5d [Chore](workflow) add clang-tidy workflow (#14737)
c804024e5d is described below

commit c804024e5d11e46efba5f8f0fa6107dddb158a3b
Author: Pxl <[email protected]>
AuthorDate: Fri Dec 2 14:10:29 2022 +0800

    [Chore](workflow) add clang-tidy workflow (#14737)
    
    add clang-tidy workflow
---
 .github/actions/clang-tidy-review                  |  1 +
 .github/workflows/be-ut-clang.yml                  |  3 +-
 .github/workflows/build-thirdparty.yml             |  2 +-
 .../{be-ut-clang.yml => clang-checks.yml}          | 79 +++++++++++++++-------
 .github/workflows/clang-format.yml                 | 56 ---------------
 .gitmodules                                        |  3 +
 build.sh                                           | 14 +++-
 7 files changed, 70 insertions(+), 88 deletions(-)

diff --git a/.github/actions/clang-tidy-review 
b/.github/actions/clang-tidy-review
new file mode 160000
index 0000000000..79d70e7c89
--- /dev/null
+++ b/.github/actions/clang-tidy-review
@@ -0,0 +1 @@
+Subproject commit 79d70e7c89de1bda6ad68610cde18d2783749852
diff --git a/.github/workflows/be-ut-clang.yml 
b/.github/workflows/be-ut-clang.yml
index aa09e705e5..d6361f98fb 100644
--- a/.github/workflows/be-ut-clang.yml
+++ b/.github/workflows/be-ut-clang.yml
@@ -62,7 +62,7 @@ jobs:
           export DEFAULT_DIR='/opt/doris'
 
           mkdir "${DEFAULT_DIR}"
-          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.12/ldb_toolchain_gen.sh
 \
+          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.14.2/ldb_toolchain_gen.sh
 \
             -q -O /tmp/ldb_toolchain_gen.sh
           bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
 
@@ -82,4 +82,3 @@ jobs:
 
           export 
PATH="${DEFAULT_DIR}/ldb-toolchain/bin/:$(pwd)/thirdparty/installed/bin/:${PATH}"
           DORIS_TOOLCHAIN=clang ./run-be-ut.sh -j "$(nproc)" --run --clean
-
diff --git a/.github/workflows/build-thirdparty.yml 
b/.github/workflows/build-thirdparty.yml
index 3f6e19dd13..0314fa228d 100644
--- a/.github/workflows/build-thirdparty.yml
+++ b/.github/workflows/build-thirdparty.yml
@@ -96,7 +96,7 @@ jobs:
           sudo DEBIAN_FRONTEND=noninteractive apt install --yes 
"${packages[@]}"
 
           mkdir -p "${DEFAULT_DIR}"
-          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.12/ldb_toolchain_gen.sh
 \
+          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.14.2/ldb_toolchain_gen.sh
 \
             -q -O /tmp/ldb_toolchain_gen.sh
           bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
 
diff --git a/.github/workflows/be-ut-clang.yml 
b/.github/workflows/clang-checks.yml
similarity index 56%
copy from .github/workflows/be-ut-clang.yml
copy to .github/workflows/clang-checks.yml
index aa09e705e5..be8dde67d4 100644
--- a/.github/workflows/be-ut-clang.yml
+++ b/.github/workflows/clang-checks.yml
@@ -14,31 +14,57 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+#
 
-name: BE UT (Clang)
-
-on:
-  pull_request:
-  schedule:
-    - cron: '0 4,10,16,22 * * *'    # schedule it periodically to share the 
cache
+---
+name: BE Code Checks
 
-concurrency:
-  group: ${{ github.ref }} (BE UT Clang)
-  cancel-in-progress: true
+on: [push, pull_request]
 
 jobs:
-  run-ut:
-    name: BE UT (Clang)
-    runs-on: ubuntu-20.04
+  clang-format:
+    name: "Clang Formatter"
+    runs-on: ubuntu-latest
     steps:
-      - name: Checkout
+      - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+        uses: actions/checkout@v3
+        with:
+          persist-credentials: false
+          submodules: recursive
+
+      - name: Paths filter
+        uses: ./.github/actions/paths-filter
+        id: filter
+        with:
+          filters: |
+            be_changes:
+              - 'be/src/**'
+              - 'be/test/**'
+
+      - name: "Format it!"
+        if: ${{ steps.filter.outputs.be_changes == 'true' }}
+        uses: ./.github/actions/clang-format-lint-action
+        id: be_clang_format
+        with:
+          source: "be/src be/test"
+          clangFormatVersion: 15
+          inplace: False
+
+      - name: Ignore it!
+        if: ${{ steps.filter.outputs.be_changes == 'false' }}
+        run: echo 'No need to check.'
+
+  clang-tidy:
+    name: "Clang Tidy"
+    runs-on: ubuntu-22.04
+    steps:
+      - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
         uses: actions/checkout@v3
         with:
           persist-credentials: false
           submodules: recursive
 
       - name: Paths Filter
-        if: ${{ github.event_name != 'schedule' }}
         uses: ./.github/actions/paths-filter
         id: filter
         with:
@@ -48,21 +74,13 @@ jobs:
               - 'gensrc/proto/**'
               - 'gensrc/thrift/**'
 
-      - name: Ccache ${{ github.ref }}
-        if: ${{ github.event_name == 'schedule' || 
steps.filter.outputs.be_changes == 'true' }}
-        uses: ./.github/actions/ccache-action
-        with:
-          key: BE-UT-Clang
-          max-size: "2G"
-          restore-keys: BE-UT-Clang-
-
-      - name: Run UT ${{ github.ref }}
-        if: ${{ github.event_name == 'schedule' || 
steps.filter.outputs.be_changes == 'true' }}
+      - name: Generate compile_commands.json
+        if: ${{ github.event_name == 'pull_request' && 
steps.filter.outputs.be_changes == 'true'}}
         run: |
           export DEFAULT_DIR='/opt/doris'
 
           mkdir "${DEFAULT_DIR}"
-          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.12/ldb_toolchain_gen.sh
 \
+          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.14.2/ldb_toolchain_gen.sh
 \
             -q -O /tmp/ldb_toolchain_gen.sh
           bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
 
@@ -81,5 +99,14 @@ jobs:
           popd
 
           export 
PATH="${DEFAULT_DIR}/ldb-toolchain/bin/:$(pwd)/thirdparty/installed/bin/:${PATH}"
-          DORIS_TOOLCHAIN=clang ./run-be-ut.sh -j "$(nproc)" --run --clean
+          DISABLE_JAVA_UDF=ON DORIS_TOOLCHAIN=clang OUTPUT_BE_BINARY=0 
./build.sh --be
+
+      - name: Run clang-tidy review
+        if: ${{ github.event_name == 'pull_request' && 
steps.filter.outputs.be_changes == 'true'}}
+        uses: ./.github/actions/clang-tidy-review
+        id: review
+        with:
+          build_dir: ./be/build_Release
 
+      - if: steps.review.outputs.total_comments > 0
+        run: exit 1
diff --git a/.github/workflows/clang-format.yml 
b/.github/workflows/clang-format.yml
deleted file mode 100644
index df4a75af2e..0000000000
--- a/.github/workflows/clang-format.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
----
-name: BE Code Formatter
-on:
-  pull_request:
-  push:
-
-jobs:
-  clang-format:
-    name: "Clang Formatter"
-    runs-on: ubuntu-latest
-    steps:
-      - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
-        uses: actions/checkout@v2
-        with:
-          persist-credentials: false
-          submodules: recursive
-
-      - name: Paths filter
-        uses: ./.github/actions/paths-filter
-        id: filter
-        with:
-          filters: |
-            be_changes:
-              - 'be/src/**'
-              - 'be/test/**'
-
-      - name: "Format it!"
-        if: ${{ steps.filter.outputs.be_changes == 'true' }}
-        uses: ./.github/actions/clang-format-lint-action
-        id: be_clang_format
-        with:
-          source: 'be/src be/test'
-          clangFormatVersion: 15
-          inplace: False
-
-      - name: Ignore it!
-        if: ${{ steps.filter.outputs.be_changes == 'false' }}
-        run: echo 'No need to check.'
diff --git a/.gitmodules b/.gitmodules
index 7f8c88c5ef..145e050d54 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -22,3 +22,6 @@
 [submodule ".github/actions/action-sh-checker"]
        path = .github/actions/action-sh-checker
        url = https://github.com/luizm/action-sh-checker
+[submodule ".github/actions/clang-tidy-review"]
+       path = .github/actions/clang-tidy-review
+       url = https://github.com/ZedThree/clang-tidy-review.git
diff --git a/build.sh b/build.sh
index b55aa7a7e1..3578fdaa4c 100755
--- a/build.sh
+++ b/build.sh
@@ -282,6 +282,10 @@ if [[ -z "${USE_DWARF}" ]]; then
     USE_DWARF='OFF'
 fi
 
+if [[ -z "${OUTPUT_BE_BINARY}" ]]; then
+    OUTPUT_BE_BINARY=${BUILD_BE}
+fi
+
 if [[ -z "${DISABLE_JAVA_UDF}" ]]; then
     DISABLE_JAVA_UDF='OFF'
 fi
@@ -411,8 +415,12 @@ if [[ "${BUILD_BE}" -eq 1 ]]; then
         -DGLIBC_COMPATIBILITY="${GLIBC_COMPATIBILITY}" \
         -DEXTRA_CXX_FLAGS="${EXTRA_CXX_FLAGS}" \
         "${DORIS_HOME}/be"
-    "${BUILD_SYSTEM}" -j "${PARALLEL}"
-    "${BUILD_SYSTEM}" install
+
+    if [[ "${OUTPUT_BE_BINARY}" -eq 1 ]]; then
+        "${BUILD_SYSTEM}" -j "${PARALLEL}"
+        "${BUILD_SYSTEM}" install
+    fi
+
     cd "${DORIS_HOME}"
 fi
 
@@ -504,7 +512,7 @@ if [[ "${BUILD_SPARK_DPP}" -eq 1 ]]; then
     cp -r -p 
"${DORIS_HOME}/fe/spark-dpp/target"/spark-dpp-*-jar-with-dependencies.jar 
"${DORIS_OUTPUT}/fe/spark-dpp"/
 fi
 
-if [[ "${BUILD_BE}" -eq 1 ]]; then
+if [[ "${OUTPUT_BE_BINARY}" -eq 1 ]]; then
     install -d "${DORIS_OUTPUT}/be/bin" \
         "${DORIS_OUTPUT}/be/conf" \
         "${DORIS_OUTPUT}/be/lib" \


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to