| # SPDX-FileCopyrightText: The Eigen Authors | |
| # SPDX-License-Identifier: MPL-2.0 | |
| # clang-format, codespell, REUSE and the unit tests of the pipeline's Python | |
| # helpers, in one job: each is seconds of work behind a runner start-up, image | |
| # pull and clone that separate jobs paid four times. REUSE and the helper | |
| # tests block; clang-format and codespell are advisory, so their failures alone | |
| # exit 3 and render the job as a warning. lint-report.xml names the failing | |
| # check in the merge request widget. | |
| checkformat:lint: | |
| stage: checkformat | |
| image: ${EIGEN_CI_IMAGE_LINUX_LINT} | |
| only: | |
| - merge_requests | |
| allow_failure: | |
| exit_codes: [ 3 ] | |
| script: | |
| - sh ci/lint/lint.sh ${CI_MERGE_REQUEST_DIFF_BASE_SHA} | |
| artifacts: | |
| when: always | |
| reports: | |
| junit: lint-report.xml | |
| expire_in: 2 days | |
| checkformat:clangtidy: | |
| stage: checkformat | |
| image: ${EIGEN_CI_IMAGE_LINUX_TIDY} | |
| only: | |
| - merge_requests | |
| allow_failure: true | |
| # Each selected compilation-database entry is a separate one-to-two-minute | |
| # parse; an MR touching several split tests (!2940: eleven test files, nine | |
| # parts) needs ~20 minutes, and the 15m cap left its last files unchecked. | |
| # The job is advisory, so the cap only costs runner minutes when there is | |
| # that much to check. | |
| timeout: 1h | |
| tags: | |
| - saas-linux-medium-amd64 | |
| 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: | |
| # Don't reuse a configuration from the apt-installed toolchain. | |
| key: clang-tidy-config-image | |
| paths: | |
| - .tidy-build/compile_commands.json | |
| - .tidy-build/CMakeCache.txt | |
| - .tidy-build/CMakeFiles/ |