Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci-post-commit-analyzer-launcher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
ccache "$@"
"$@" --analyze --analyzer-output html -o analyzer-results \
-Xclang -analyzer-config -Xclang max-nodes=75000
30 changes: 8 additions & 22 deletions .github/workflows/ci-post-commit-analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,12 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get -y install \
wget \
gnupg
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | tee -a /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt-get update
apt-get -y install \
cmake \
ninja-build \
perl \
clang-tools-$LLVM_VERSION \
clang-$LLVM_VERSION
clang-tools

- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
Expand All @@ -76,33 +69,26 @@ jobs:

- name: Configure
run: |
scan-build-$LLVM_VERSION \
--use-c++='clang++' \
--use-cc='clang' \
-analyzer-config max-nodes=75000 \
cmake -B build -S llvm -G Ninja \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER_LAUNCHER=`pwd`/.github/workflows/ci-post-commit-analyzer-launcher.sh \
-DCMAKE_C_COMPILER_LAUNCHER=`pwd`/.github/workflows/ci-post-commit-analyzer-launcher.sh \
-DCMAKE_BUILD_TYPE=Release

- name: Build
run: |
# Create symlinks for use with ccache.
ln -s /usr/bin/ccache /usr/local/bin/clang++
ln -s /usr/bin/ccache /usr/local/bin/clang
scan-build-$LLVM_VERSION \
-o analyzer-results \
--use-c++=/usr/local/bin/clang++ \
--use-cc=/usr/local/bin/clang \
-analyzer-config max-nodes=75000 \
ninja -v -C build
ninja -v -C build
scan-build --generate-index-only build/analyzer-results

- name: Upload Results
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
if: always()
with:
name: analyzer-results
path: 'analyzer-results/**/*'
path: 'build/analyzer-results/**/*'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but I suspect that you should remove the /** part now. Because now that you removed scan-build nobody is creating that subdirectory with today's date anymore. All the HTML files go straight into analyzer-results now.