Skip to content

Commit

Permalink
chore(ci): run clang-tidy in parallel (#914)
Browse files Browse the repository at this point in the history
Fixes #899.
  • Loading branch information
lidavidm authored Jul 19, 2023
1 parent 788743e commit f667211
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/native-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ jobs:
shell: bash -l {0}
run: |
mamba install -c conda-forge \
--file ci/conda_env_cpp.txt
--file ci/conda_env_cpp.txt \
--file ci/conda_env_cpp_lint.txt
- name: clang-tidy
shell: bash -l {0}
Expand Down
19 changes: 19 additions & 0 deletions ci/conda_env_cpp_lint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.

clang=14
clang-tools=14
9 changes: 5 additions & 4 deletions ci/scripts/cpp_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ build_subproject() {
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"

clang-tidy \
-p "${build_dir}/compile_commands.json" \
--fix \
--quiet \
run-clang-tidy \
-j $(nproc) \
-p "${build_dir}" \
-fix \
-quiet \
$(jq -r ".[] | .file" "${build_dir}/compile_commands.json")

set +x
Expand Down

0 comments on commit f667211

Please sign in to comment.