CI: Added configuring clang for tidy checks
Some checks failed
PR Check / on-push-commit-check (push) Failing after 9m19s
Some checks failed
PR Check / on-push-commit-check (push) Failing after 9m19s
This commit is contained in:
parent
ab3fc26003
commit
0ef4499c44
2 changed files with 22 additions and 24 deletions
|
@ -10,7 +10,7 @@ FROM archlinux@sha256:a10e51dd0694d6c4142754e9d06cbce7baf91ace8031a30df37064d109
|
||||||
RUN pacman -Syyu --noconfirm \
|
RUN pacman -Syyu --noconfirm \
|
||||||
&& pacman -Syyu --noconfirm git less vim sudo python-pip wget which pkgconf \
|
&& pacman -Syyu --noconfirm git less vim sudo python-pip wget which pkgconf \
|
||||||
&& pacman -Syyu --noconfirm cmake make gcc ninja meson shellcheck \
|
&& pacman -Syyu --noconfirm cmake make gcc ninja meson shellcheck \
|
||||||
&& pacman -Syyu --noconfirm gtk4 gtkmm-4.0 boost spdlog fmt libxml++-5.0
|
&& pacman -Syyu --noconfirm gtk4 gtkmm-4.0 boost spdlog fmt libxml++-5.0 gtest
|
||||||
|
|
||||||
# Create a non-root user 'dev'
|
# Create a non-root user 'dev'
|
||||||
RUN useradd -ms /bin/bash dev \
|
RUN useradd -ms /bin/bash dev \
|
||||||
|
@ -38,6 +38,7 @@ ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VER}/L
|
||||||
# Create the LLVM directory and extract only binaries into it
|
# Create the LLVM directory and extract only binaries into it
|
||||||
RUN sudo mkdir -p /home/LLVM-${LLVM_VER}
|
RUN sudo mkdir -p /home/LLVM-${LLVM_VER}
|
||||||
RUN sudo tar -xJf /home/artifacts/LLVM-${LLVM_VER}-Linux-X64.tar.xz -C /home/LLVM-${LLVM_VER} --strip-components=1 \
|
RUN sudo tar -xJf /home/artifacts/LLVM-${LLVM_VER}-Linux-X64.tar.xz -C /home/LLVM-${LLVM_VER} --strip-components=1 \
|
||||||
|
LLVM-${LLVM_VER}-Linux-X64/bin/clangd \
|
||||||
LLVM-${LLVM_VER}-Linux-X64/bin/clang-19 \
|
LLVM-${LLVM_VER}-Linux-X64/bin/clang-19 \
|
||||||
LLVM-${LLVM_VER}-Linux-X64/bin/clang \
|
LLVM-${LLVM_VER}-Linux-X64/bin/clang \
|
||||||
LLVM-${LLVM_VER}-Linux-X64/bin/clang++ \
|
LLVM-${LLVM_VER}-Linux-X64/bin/clang++ \
|
||||||
|
|
|
@ -133,28 +133,42 @@ jobs:
|
||||||
cmake --build ${{ github.workspace }}/build_gcc --parallel `nproc`
|
cmake --build ${{ github.workspace }}/build_gcc --parallel `nproc`
|
||||||
|
|
||||||
- name: GCC unit tests
|
- name: GCC unit tests
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
cd ${{ github.workspace }}/build_gcc
|
cd ${{ github.workspace }}/build_gcc
|
||||||
./larra_xmpp_tests
|
./larra_xmpp_tests
|
||||||
|
|
||||||
|
- name: Clang build (only configuring)
|
||||||
|
run: |
|
||||||
|
export LLVM_VER=19.1.1
|
||||||
|
export PATH="/home/LLVM-${LLVM_VER}/bin:${PATH}"
|
||||||
|
mkdir -p ${{ github.workspace }}/build_clang
|
||||||
|
|
||||||
|
cmake -Wno-dev \
|
||||||
|
-DCMAKE_C_COMPILER=clang \
|
||||||
|
-DCMAKE_CXX_COMPILER=clang++ \
|
||||||
|
-S ${{ github.workspace }} \
|
||||||
|
-B ${{ github.workspace }}/build_clang \
|
||||||
|
-GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DENABLE_EXAMPLES=ON \
|
||||||
|
-DENABLE_TESTS=ON \
|
||||||
|
-DCMAKE_CXX_FLAGS="-stdlib=libc++ -I/home/LLVM-${LLVM_VER}/include/c++/v1 -fno-modules" \
|
||||||
|
-DCMAKE_EXE_LINKER_FLAGS="-L/home/LLVM-${LLVM_VER}/lib/ -Wl,-rpath,/home/LLVM-${LLVM_VER}/lib -lc++ -lc++abi -lm -lc -lgcc_s -lgcc -fuse-ld=lld"
|
||||||
|
|
||||||
- name: Check clang-tidy
|
- name: Check clang-tidy
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
export LLVM_VER=19.1.1
|
export LLVM_VER=19.1.1
|
||||||
export PATH="/home/LLVM-${LLVM_VER}/bin:${PATH}"
|
export PATH="/home/LLVM-${LLVM_VER}/bin:${PATH}"
|
||||||
cd ${{ github.workspace }}
|
cd ${{ github.workspace }}
|
||||||
|
|
||||||
sed -i 's|/usr/sbin/g++|/home/LLVM-19.1.1/bin/clang++ -stdlib=libc++ -I/home/LLVM-${LLVM_VER}/include/c++/v1|' build_gcc/compile_commands.json
|
|
||||||
sed -i 's|-fdeps-format=p1689r5||' build_gcc/compile_commands.json
|
|
||||||
sed -i 's|-fmodules-ts||' build_gcc/compile_commands.json
|
|
||||||
sed -i 's|-fmodule-mapper=.*\.modmap||' build_gcc/compile_commands.json
|
|
||||||
|
|
||||||
wget https://raw.githubusercontent.com/llvm/llvm-project/refs/heads/main/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
|
wget https://raw.githubusercontent.com/llvm/llvm-project/refs/heads/main/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
|
||||||
python run-clang-tidy.py \
|
python run-clang-tidy.py \
|
||||||
-warnings-as-errors=* \
|
-warnings-as-errors=* \
|
||||||
-use-color \
|
-use-color \
|
||||||
-exclude-header-filter .*build.* \
|
-exclude-header-filter .*build.* \
|
||||||
-header-filter .hpp \
|
-header-filter .hpp \
|
||||||
-p ${{ github.workspace }}/build_gcc/ \
|
-p ${{ github.workspace }}/build_clang/ \
|
||||||
-config-file ${{ github.workspace }}/.clang-tidy \
|
-config-file ${{ github.workspace }}/.clang-tidy \
|
||||||
\
|
\
|
||||||
${{ github.workspace }}/examples \
|
${{ github.workspace }}/examples \
|
||||||
|
@ -163,23 +177,6 @@ jobs:
|
||||||
|
|
||||||
echo "No clang-tidy violations detected!"
|
echo "No clang-tidy violations detected!"
|
||||||
|
|
||||||
#- name: Clang build with -fsanitize=address
|
|
||||||
# run: |
|
|
||||||
# export LLVM_VER=19.1.1
|
|
||||||
# export PATH="/home/LLVM-${LLVM_VER}/bin:${PATH}"
|
|
||||||
# mkdir -p ${{ github.workspace }}/build_clang
|
|
||||||
# cmake -Wno-dev \
|
|
||||||
# -DCMAKE_C_COMPILER=clang \
|
|
||||||
# -DCMAKE_CXX_COMPILER=clang++ \
|
|
||||||
# -S ${{ github.workspace }} \
|
|
||||||
# -B ${{ github.workspace }}/build_clang \
|
|
||||||
# -GNinja -DCMAKE_BUILD_TYPE=Release \
|
|
||||||
# -DENABLE_EXAMPLES=ON \
|
|
||||||
# -DENABLE_TESTS=ON \
|
|
||||||
# -DCMAKE_CXX_FLAGS="-stdlib=libc++ -I/home/LLVM-${LLVM_VER}/include/c++/v1 -fno-omit-frame-pointer -g -fsanitize=address,undefined,leak,function,nullability,vptr" \
|
|
||||||
# -DCMAKE_EXE_LINKER_FLAGS="-L/home/LLVM-${LLVM_VER}/lib/ -Wl,-rpath,/home/LLVM-${LLVM_VER}/lib -lc++ -lc++abi -lm -lc -lgcc_s -lgcc -fno-omit-frame-pointer -g -fsanitize=address,undefined,leak,function,nullability,vptr"
|
|
||||||
# cmake --build ${{ github.workspace }}/build_clang --parallel `nproc`
|
|
||||||
|
|
||||||
#- name: Clang unit tests with -fsanitize=address
|
#- name: Clang unit tests with -fsanitize=address
|
||||||
# run: |
|
# run: |
|
||||||
# export LLVM_VER=19.1.1
|
# export LLVM_VER=19.1.1
|
||||||
|
|
Loading…
Reference in a new issue