blob: a44ccebc0708b7aee9bbca4a6c73aadcbe85e7ce [file]
# SPDX-FileCopyrightText: The Eigen Authors
# SPDX-License-Identifier: MPL-2.0
checkformat:clangformat:
stage: checkformat
image: alpine:3.20
only:
- merge_requests
allow_failure: true
before_script:
- apk add --no-cache git clang17-extra-tools python3
script:
- git clang-format --diff --commit ${CI_MERGE_REQUEST_DIFF_BASE_SHA}
checkformat:codespell:
stage: checkformat
image: alpine:3.20
only:
- merge_requests
allow_failure: true
before_script:
- apk add --no-cache py3-codespell
script:
- codespell --config setup.cfg
checkformat:reuse:
stage: checkformat
image: alpine:3.20
only:
- merge_requests
before_script:
- apk add --no-cache py3-pip
# reuse >= 6.x needs an encoding-detection backend at import time; the Alpine image
# ships neither libmagic nor charset-normalizer, so pull in the latter explicitly.
- pip install --break-system-packages 'reuse[charset-normalizer]'
script:
- reuse lint
# The unit tests for the Python helpers that decide what the rest of the
# pipeline does: scripts/affected_tests.py chooses which tests an MR builds,
# ci/scripts/test_cache.py chooses which of them can be skipped as already
# passed, and scripts/clang_tidy_hook.py decides which edit-time diagnostics
# interrupt an agent. They fail closed, but a wrong answer is silent -- a job
# that skips too much or drops a hook diagnostic still reports success -- so
# these are blocking, and they run on every merge request rather than under the
# affected-tests label that gates select:tests (which is where the selector's
# tests used to run alone).
checkformat:scripts:
stage: checkformat
image: alpine:3.20
only:
- merge_requests
before_script:
- apk add --no-cache python3 git
script:
- python3 scripts/test_affected_tests.py
- python3 ci/scripts/test_test_cache.py
- python3 scripts/test_clang_tidy_hook.py
checkformat:clangtidy:
stage: checkformat
image: ubuntu:24.04
only:
- merge_requests
allow_failure: true
timeout: 15m
tags:
- saas-linux-medium-amd64
variables:
DEBIAN_FRONTEND: noninteractive
before_script:
- apt-get update -y > /dev/null
- apt-get install -y --no-install-recommends
git cmake ninja-build clang-tidy clang python3 ca-certificates > /dev/null
script:
- mkdir -p .tidy-build
- cmake -G Ninja -B .tidy-build
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_COMPILER=clang
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DEIGEN_BUILD_TESTING=ON
- chmod +x ci/scripts/run-clang-tidy.sh
- ci/scripts/run-clang-tidy.sh ${CI_MERGE_REQUEST_DIFF_BASE_SHA} .tidy-build
cache:
key: clang-tidy-config
paths:
- .tidy-build/compile_commands.json
- .tidy-build/CMakeCache.txt
- .tidy-build/CMakeFiles/