Skip to content
Snippets Groups Projects
Commit e751b51f authored by Emmanuele Bassi's avatar Emmanuele Bassi
Browse files

ci: Add analysis phase

Run the static analysis tool from clang, and ASan.
parent 0b6860c9
No related branches found
No related tags found
No related merge requests found
stages:
- check
- build
- analysis
- docs
- deploy
......@@ -21,6 +22,29 @@ stages:
paths:
- "_build/meson-logs"
.build-scan:
script:
- meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _scan_build .
- ninja -C _scan_build scan-build
artifacts:
name: "json-glib-static-scan-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_scan_build/meson-logs"
.build-asan:
script:
- meson setup ${MESON_EXTRA_FLAGS} -Db_sanitize=address -Db_lundef=false --prefix /usr _asan_build .
- meson compile -C _asan_build
- meson test -C _asan_build
artifacts:
name: "json-glib-asan-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_asan_build/meson-logs"
.fedora-build:
image: fedora:39
before_script:
......@@ -112,6 +136,57 @@ fedora-latest-x86_64:
MESON_VERSION: "1.2.0"
MESON_EXTRA_FLAGS: "--buildtype=debug --default-library=both -Dwerror=true -Dglib:werror=false -Dintrospection=enabled -Ddocumentation=disabled"
static-scan:
extends:
- .fedora-build
- .build-scan
stage: analysis
needs: []
variables:
FEDORA_DEPS:
clang
clang-analyzer
gettext
git
glib2-devel
ninja-build
python3
python3-docutils
python3-pip
python3-wheel
redhat-rpm-config
MESON_VERSION: "1.2.0"
MESON_EXTRA_FLAGS: "--buildtype=debug -Dintrospection=disabled -Ddocumentation=disabled"
CC: clang
allow_failure: true
# Run tests with the address sanitizer. We need to turn off introspection,
# since it is incompatible with asan
asan-debug-build:
extends:
- .fedora-build
- .build-asan
tags: [ asan ]
stage: analysis
needs: []
variables:
FEDORA_DEPS:
clang
gettext
git
glib2-devel
libasan
ninja-build
python3
python3-docutils
python3-pip
python3-wheel
redhat-rpm-config
MESON_VERSION: "1.2.0"
MESON_EXTRA_FLAGS: "--buildtype=debug -Dintrospection=disabled -Ddocumentation=disabled"
CC: clang
allow_failure: true
reference:
stage: docs
needs: []
......
......@@ -48,7 +48,7 @@ if get_option('man') and rst2man.found()
endforeach
endif
if build_doc
if build_doc and gidocgen.found()
json_docdir = json_datadir / 'doc'
toml_conf = configuration_data()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment