Skip to content

Commit fed8c86

Browse files
committed
[INFRA] Add CodeChecker and CodeQL
1 parent 48edfcb commit fed8c86

File tree

5 files changed

+136
-0
lines changed

5 files changed

+136
-0
lines changed

.github/config/codechecker.skip

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
+${GITHUB_WORKSPACE}/*
6+
-*

.github/config/codechecker.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
analyze:
6+
- --enable=performance
7+
- --enable=bugprone
8+
- --enable=clang-diagnostic-shadow
9+
- --disable=bugprone-easily-swappable-parameters
10+
- --disable=clang-diagnostic-implicit-int-float-conversion
11+
- --disable=clang-diagnostic-float-conversion
12+
- --disable=clang-diagnostic-implicit-int-conversion
13+
- --disable=bugprone-exception-escape
14+
- --disable=bugprone-narrowing-conversions
15+
- --disable=deadcode.DeadStores
16+
- --skip=${GITHUB_WORKSPACE}/.github/config/codechecker.skip
17+
- --clean
18+
19+
parse:
20+
- --export=html
21+
- --output=./html
22+
- --skip=${GITHUB_WORKSPACE}/.github/config/codechecker.skip
23+
- --trim-path-prefix=${GITHUB_WORKSPACE}/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: CodeChecker
6+
7+
on:
8+
schedule:
9+
- cron: "0 8 * * MON"
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: codechecker-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
SHARG_NO_VERSION_CHECK: 1
18+
TZ: Europe/Berlin
19+
20+
defaults:
21+
run:
22+
shell: bash -Eexuo pipefail {0}
23+
24+
jobs:
25+
build:
26+
name: CodeChecker
27+
runs-on: ubuntu-latest
28+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
29+
container:
30+
image: ghcr.io/seqan/clang-19
31+
steps:
32+
- name: Run CodeChecker
33+
uses: seqan/actions/codechecker@main
34+
with:
35+
configure_path: ../test/analyse
36+
deploy_host: ${{ secrets.DEPLOY_HOST }}
37+
deploy_user: ${{ secrets.DEPLOY_USER }}
38+
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
39+
deploy_path: ${{ secrets.DEPLOY_CODECHECKER_PATH }}

.github/workflows/cron_codeql.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: CodeQL
6+
7+
on:
8+
schedule:
9+
- cron: "0 21 * * MON"
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: codeql-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
SHARG_NO_VERSION_CHECK: 1
18+
TZ: Europe/Berlin
19+
20+
defaults:
21+
run:
22+
shell: bash -Eeuxo pipefail {0}
23+
24+
jobs:
25+
codeql:
26+
name: CodeQL
27+
runs-on: ubuntu-latest
28+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
29+
permissions:
30+
security-events: write
31+
container:
32+
image: ghcr.io/seqan/gcc-14
33+
volumes:
34+
- /home/runner:/home/runner
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@v3
41+
with:
42+
languages: cpp
43+
build-mode: manual
44+
trap-caching: false
45+
46+
- name: Build tests
47+
run: |
48+
cmake test/analyse -DCMAKE_BUILD_TYPE=Release \
49+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
50+
make -k
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@v3
54+
with:
55+
category: "/language:cpp"

test/analyse/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
cmake_minimum_required (VERSION 3.20...3.31)
6+
project (sharg_test_analyze CXX)
7+
8+
include (../sharg-test.cmake)
9+
10+
enable_testing ()
11+
12+
add_subdirectory (../snippet snippet)
13+
add_subdirectory (../unit unit)

0 commit comments

Comments
 (0)