Skip to content

Commit 5d32982

Browse files
authored
🚨 Update cpp-linter configuration (#77)
* 🚸 explicitly install MLIR in cpp-linter run and expose the respective variables * 🚸 improve the ignore filter in the cpp-linter * 🔧 explicitly run cpp-linter on `mlir/**` changes * 🔧 do not ignore the mlir build directory * ⚗️ try a glob expression for the inclusion of MLIR * 🚨 do not lint header files they are not part of a compilation database so their include paths and linker paths are not set. Signed-off-by: burgholzer <[email protected]> --------- Signed-off-by: burgholzer <[email protected]>
1 parent 15276e2 commit 5d32982

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/reusable-change-detection.yml

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
!src/python/**
8080
test/**
8181
!test/python/**
82+
mlir/**
8283
.clang-tidy
8384
.github/workflows/reusable-cpp-linter.yml
8485
.github/workflows/ci.yml

.github/workflows/reusable-cpp-linter.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,36 @@ jobs:
4444
uses: cda-tum/setup-z3@v1
4545
with:
4646
version: ${{ inputs.z3-version }}
47-
# install a specific version of clang
48-
- name: Install clang-${{ env.clang-version }}
47+
# install a specific version of the LLVM toolchain
48+
- name: Install llvm@${{ env.clang-version }}
4949
run: |
5050
sudo apt-get update
5151
wget https://apt.llvm.org/llvm.sh -O ${{ runner.temp }}/llvm_install.sh
5252
chmod +x ${{ runner.temp }}/llvm_install.sh
5353
if sudo ${{ runner.temp }}/llvm_install.sh ${{ env.clang-version }}; then
54-
sudo apt-get install -y clang-format-${{ env.clang-version }} clang-tidy-${{ env.clang-version }} || exit 1
54+
sudo apt-get install -y clang-format-${{ env.clang-version }} \
55+
clang-tidy-${{ env.clang-version }} \
56+
libmlir-${{ env.clang-version }}-dev \
57+
mlir-${{ env.clang-version }}-tools \
58+
clang-${{ env.clang-version}} \
59+
|| exit 1
5560
else
5661
echo "Installation from script failed."
5762
exit 1
5863
fi
5964
echo "CC=clang-${{ env.clang-version }}" >> $GITHUB_ENV
6065
echo "CXX=clang++-${{ env.clang-version }}" >> $GITHUB_ENV
66+
echo "MLIR_DIR=/usr/lib/llvm-${{ env.clang-version }}/lib/cmake/mlir" >> $GITHUB_ENV
67+
echo "LLVM_DIR=/usr/lib/llvm-${{ env.clang-version }}/lib/cmake/llvm" >> $GITHUB_ENV
6168
# generate a compilation database (assumes that the CMake project has `CMAKE_EXPORT_COMPILE_COMMANDS` set)
6269
- name: Generate compilation database
6370
run: |
6471
echo $CC
6572
echo $CXX
6673
$CC --version
6774
$CXX --version
75+
echo $MLIR_DIR
76+
echo $LLVM_DIR
6877
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug ${{ inputs.cmake-args }}
6978
# runs the cpp-linter action using the generated compilation database and the specified clang version
7079
- name: Run cpp-linter
@@ -76,7 +85,7 @@ jobs:
7685
style: ""
7786
tidy-checks: ""
7887
version: ${{ env.clang-version }}
79-
ignore: "build|include/python|src/python"
88+
ignore: "build|!build/mlir/**|**/python|**/include"
8089
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
8190
step-summary: true
8291
database: "build"

0 commit comments

Comments
 (0)