Skip to content

Commit 2e79c50

Browse files
asaezpercodebot
authored andcommitted
ci: add incremental clang-tidy
1 parent 34fc9a6 commit 2e79c50

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

.gitlab-ci.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ full-code-format:
384384
- |
385385
echo "
386386
-/usr/lib
387+
-*CMakeTmp
388+
-*CompilerIdCXX
387389
-*tests/unittests
388390
-*tests/integrationtests
389391
-*tests/benchmarks
@@ -413,7 +415,7 @@ full-code-format:
413415
done
414416
}
415417
export -f monitor_child_process
416-
script:
418+
script: &codechecker_script
417419
- nohup bash -c monitor_child_process &
418420
- static-analyzer.sh -i /tmp/codechecker_skip --jobs ${KUBERNETES_CPU_REQUEST} --analyzers ${ANALYZER} ${ANALYZER_ARGS} $CI_PROJECT_DIR
419421
after_script:
@@ -428,6 +430,17 @@ full-code-format:
428430

429431
clang-tidy:
430432
extends: .codechecker
433+
rules:
434+
- if: $CI_DESCRIPTION =~ /Nightly Build Unit Tests/
435+
interruptible: false
436+
retry: 2
437+
variables:
438+
ANALYZER: clang-tidy
439+
ANALYZER_ARGS: --analyzer-config clang-tidy:take-config-from-directory=true --tidy-config .clang-tidy
440+
ARTIFACT_EXTRA_PATH: "/index.html"
441+
442+
clang-tidy incremental:
443+
extends: clang-tidy
431444
stage: manual
432445
rules:
433446
- if: $ON_MR == "true" && $CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED == "true" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
@@ -437,9 +450,26 @@ clang-tidy:
437450
when: manual
438451
allow_failure: false
439452
variables:
440-
ANALYZER: clang-tidy
441-
ANALYZER_ARGS: --analyzer-config clang-tidy:take-config-from-directory=true --tidy-config .clang-tidy
442-
ARTIFACT_EXTRA_PATH: "/index.html"
453+
CCACHE_MAXSIZE: 3G
454+
CACHE_COMPRESSION_LEVEL: slowest
455+
CACHE_REQUEST_TIMEOUT: 5 # minutes - 10 by default
456+
script:
457+
- |
458+
cd $CI_PROJECT_DIR
459+
git config advice.detachedHead false
460+
git config --local core.hooksPath /dev/null
461+
git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
462+
- |
463+
for rev in $CI_MERGE_REQUEST_TARGET_BRANCH_NAME $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME; do
464+
git checkout $rev
465+
CodeChecker log -o ${CI_PROJECT_DIR}/build/compile_commands.json --build "builder.sh -m -j${KUBERNETES_CPU_REQUEST} -c clang -DMARCH=x86-64-v3 -DENABLE_ARMPL=False -DENABLE_MKL=False -DENABLE_FFTW=True -DASSERT_LEVEL=PARANOID -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=False $CI_PROJECT_DIR"
466+
done
467+
- *codechecker_script
468+
cache:
469+
- key: codechecker-clang-tidy
470+
paths: [ccache]
471+
policy: pull-push
472+
when: always
443473

444474
cppcheck:
445475
extends: .codechecker

.gitlab/ci/builders/archlinux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# the distribution.
77
#
88

9-
ARG VERSION=base-20250810.0.398652
9+
ARG VERSION=base-20250824.0.410029
1010
FROM archlinux:$VERSION
1111

1212
ADD install_dependencies.sh /usr/local/bin

.gitlab/ci/builders/codechecker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
ARG CR_REGISTRY_URI
1010
ARG CI_TOOLS_REPO
11-
ARG CODECHECKER_VERSION=1.0.1
11+
ARG CODECHECKER_VERSION=6.26.1
1212

1313
FROM ${CR_REGISTRY_URI}/${CI_TOOLS_REPO}/codechecker:${CODECHECKER_VERSION}
1414

15-
ADD install_dependencies.sh /usr/local/bin
16-
RUN chmod +x /usr/local/bin/install_dependencies.sh
15+
ADD install_dependencies.sh builder.sh /usr/local/bin/
16+
RUN chmod +x /usr/local/bin/install_dependencies.sh /usr/local/bin/builder.sh
1717

1818
RUN DEBIAN_FRONTEND=noninteractive apt-get update && install_dependencies.sh \
1919
&& apt-get install -y --no-install-recommends git \

0 commit comments

Comments
 (0)