adonis0147 commented on code in PR #14709:
URL: https://github.com/apache/doris/pull/14709#discussion_r1036669945


##########
.github/workflows/clang-format.yml:
##########
@@ -54,3 +54,57 @@ jobs:
       - name: Ignore it!
         if: ${{ steps.filter.outputs.be_changes == 'false' }}
         run: echo 'No need to check.'
+
+  clang-tidy:
+    name: "Clang Tidy"
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Checkout
+        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/**'
+              - 'gensrc/proto/**'
+              - 'gensrc/thrift/**'
+      
+      - name: Generate compile_commands.json
+        run: |
+          export DEFAULT_DIR='/opt/doris'
+
+          mkdir "${DEFAULT_DIR}"
+          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"
+
+          sudo apt update
+          sudo apt upgrade --yes
+          sudo DEBIAN_FRONTEND=noninteractive apt install --yes tzdata byacc
+
+          # set timezone
+          sudo ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
+          sudo dpkg-reconfigure --frontend noninteractive tzdata
+
+          pushd thirdparty
+          curl -L 
https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-linux-x86_64.tar.xz
 \
+            -o doris-thirdparty-prebuilt-linux-x86_64.tar.xz
+          tar -xvf doris-thirdparty-prebuilt-linux-x86_64.tar.xz
+          popd
+
+          export 
PATH="${DEFAULT_DIR}/ldb-toolchain/bin/:$(pwd)/thirdparty/installed/bin/:${PATH}"
+          DORIS_TOOLCHAIN=clang OUTPUT_BE_BINARY=0 ./build.sh --be

Review Comment:
   Just using command `cmake </path/contains/CMakeLists.txt>` can generate 
`compile_commands.json`.
   
   Like this.
   ```shell
   mkdir build
   pushd build
   cmake ../be
   popd
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to