Files
eg25-manager/.gitlab-ci.yml
Arnaud Ferraris 9f8ae70cba gitlab-ci: add static analysis check
Similar to the formatting check job, take advantage of the `clang-tidy`
configuration we just created to add a new job running this tool.

Running `clang-tidy` requires the following:
* build dependencies must be present on the system so it can resolve the
  includes
* the build folder must be configured as it relies on the
  `compile_commands.json` to get build flags (such as the include paths)

This could be run in the `build` job, but it would make it harder to
understand the actual underlying issue, so this is executed as a new,
separate job, re-using the artifacts from the `build` job.
2024-11-12 13:10:43 +01:00

50 lines
1.1 KiB
YAML

stages:
- build
- check
variables:
CLANG_VERSION: 19
BUILD_DEPS_NO_MM: "build-essential libcurl4-openssl-dev libgpiod-dev libgudev-1.0-dev libusb-1.0-0-dev meson scdoc"
BUILD_DEPS: "${BUILD_DEPS_NO_MM} libmm-glib-dev"
image: debian:unstable-slim
build:
stage: build
script:
- apt-get update
- apt-get -y install ${BUILD_DEPS}
- meson build
- meson compile -C build
artifacts:
paths:
- build
# ModemManager is an optional dependency, let's ensure eg25-manager still builds fine without it
build-no-mm:
stage: build
script:
- apt-get update
- apt-get -y install ${BUILD_DEPS_NO_MM}
- meson build
- meson compile -C build
format:
stage: check
dependencies:
- build
script:
- apt-get update
- apt-get -y install ${BUILD_DEPS} clang-format-${CLANG_VERSION}
- ninja -C build clang-format-check
check:
stage: check
dependencies:
- build
script:
- apt-get update
# clang-tidy needs all dependencies to be installed so it can inspect their headers
- apt-get -y install ${BUILD_DEPS} clang-tidy-${CLANG_VERSION}
- ninja -C build clang-tidy