Skip to content

Commit

Permalink
[INFRA] Update codechecker CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Nov 24, 2024
1 parent e61e1e8 commit e4fc052
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 91 deletions.
16 changes: 0 additions & 16 deletions .clang-tidy

This file was deleted.

7 changes: 7 additions & 0 deletions .github/config/codechecker.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0

-${GITHUB_WORKSPACE}/include/hibf/contrib/*
+${GITHUB_WORKSPACE}/*
-*
22 changes: 22 additions & 0 deletions .github/config/codechecker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2006-2023, Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0

analyze:
- --enable=performance
- --enable=bugprone
- --enable=clang-diagnostic-shadow
- --disable=bugprone-easily-swappable-parameters
- --disable=clang-diagnostic-implicit-int-float-conversion
- --disable=clang-diagnostic-float-conversion
- --disable=bugprone-exception-escape
- --disable=bugprone-narrowing-conversions
- --disable=deadcode.DeadStores
- --skip=${GITHUB_WORKSPACE}/.github/config/codechecker.skip
- --clean

parse:
- --export=html
- --output=./html
- --skip=${GITHUB_WORKSPACE}/.github/config/codechecker.skip
- --trim-path-prefix=${GITHUB_WORKSPACE}/
63 changes: 2 additions & 61 deletions .github/workflows/ci_codechecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,69 +30,10 @@ jobs:
volumes:
- /home/runner:/home/runner
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
run: |
apt-get update
apt-get install --yes python3-venv python3-dev g++-14 cppcheck
apt-get remove --yes ccache
python3 -m venv /venv
{ set +x; source /venv/bin/activate; set -x; }
pip install codechecker
echo "CC_ANALYZER_BIN=clangsa:$(which clang-19);clang-tidy:$(which clang-tidy-19);gcc:$(which g++-14)" >> $GITHUB_ENV
wget -O codechecker.patch https://github.com/eseiler/codechecker/commit/2cbb867eb305f7cec93a6a7dbbd64b1ff131e8b2.patch
patch_me=$(find /venv/ -path '*/codechecker_report_converter/report/output/html/html.py')
patch --batch --forward --quiet --reject-file=- ${patch_me} codechecker.patch || true
rm codechecker.patch
- name: Run CodeChecker
run: |
{ set +x; source /venv/bin/activate; set -x; }
cmake . -DCMAKE_CXX_COMPILER=clang++-19 \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
CodeChecker analyzers -o table
CodeChecker check --logfile compile_commands.json \
--jobs $(nproc) \
--enable performance \
--enable bugprone \
--enable clang-diagnostic-shadow \
--disable bugprone-easily-swappable-parameters \
--disable clang-diagnostic-implicit-int-float-conversion \
--disable clang-diagnostic-float-conversion \
--disable clang-diagnostic-implicit-int-conversion \
--disable bugprone-exception-escape \
--disable bugprone-narrowing-conversions \
--disable deadcode.DeadStores \
--output ./results 2>/dev/null | grep --line-buffered -E "\[[0-9]+/[0-9]+\]" || true
echo "-${GITHUB_WORKSPACE}/include/hibf/contrib/*" > skipfile
echo "+${GITHUB_WORKSPACE}/*" >> skipfile
echo "-*" >> skipfile
CodeChecker parse ./results \
--export html \
--output ./html \
--skip skipfile \
--trim-path-prefix "${GITHUB_WORKSPACE}/" > parse.log || true
awk '/----====/{y=1;}y' parse.log
sed -i 's/<option value="100">/<option value="100" selected>/g' html/index.html
sed -i 's@<title>Plist HTML Viewer</title>@<title>CodeChecker hibf</title>@g' html/*.html
- name: Upload Report
if: github.repository_owner != 'seqan'
uses: actions/upload-artifact@v4
with:
name: codechecker-report
path: html

- name: Deploy Report
if: github.repository_owner == 'seqan'
uses: seqan/actions/documentation_deploy_production@main
uses: seqan/actions/codechecker@main
with:
deploy_host: ${{ secrets.DEPLOY_HOST }}
deploy_user: ${{ secrets.DEPLOY_USER }}
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
source_path_user_doc: html/
deploy_path_user_doc: ${{ secrets.DEPLOY_CODECHECKER_PATH }}
deploy_path: ${{ secrets.DEPLOY_CODECHECKER_PATH }}
14 changes: 0 additions & 14 deletions test/clang_tidy/CMakeLists.txt

This file was deleted.

0 comments on commit e4fc052

Please sign in to comment.