ci: Exclude tests from scan-build analysis runs

They cause too much noise at the moment. I want to make scan-build
messages fatal, and with 66 of 238 reports coming from the tests,
that’s not currently feasible.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #1767
This commit is contained in:
Philip Withnall 2024-04-03 23:21:31 +01:00
parent 4607dd77a1
commit 2dfd9518e1
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73
2 changed files with 26 additions and 1 deletions

View File

@ -725,6 +725,16 @@ scan-build:
image: $FEDORA_IMAGE
stage: analysis
needs: []
variables:
# FIXME: Eventually we want static analysis on the tests, for code quality,
# but for the moment its just busywork.
SCAN_BUILD_FLAGS: >-
--exclude gio/tests/
--exclude girepository/tests/
--exclude glib/tests/
--exclude gmodule/tests/
--exclude gobject/tests/
--exclude gthread/tests/
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
@ -737,7 +747,7 @@ scan-build:
-Dinstalled_tests=true
-Dintrospection=enabled
_scan_build
- ninja -C _scan_build scan-build
- SCANBUILD="$(pwd)/.gitlab-ci/scan-build.sh" ninja -C _scan_build scan-build
artifacts:
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always

15
.gitlab-ci/scan-build.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
#
# Copyright 2024 GNOME Foundation, Inc.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Philip Withnall
set -eu
# This script just exists so that we can set the scan-build flags in
# .gitlab-ci.yml and pass them into Mesons `scan-build` target.
# shellcheck disable=SC2086
exec scan-build ${SCAN_BUILD_FLAGS:-} "$@"