libsecret/.gitlab-ci.yml
Dhanuka da9637edee Enable static analyzer in CI
These changes enable clang-analyzer and cppcheck static analyzers.

Fixes: https://gitlab.gnome.org/GNOME/libsecret/-/issues/51
2021-03-10 15:40:40 +00:00

114 lines
3.0 KiB
YAML

stages:
- build
- deploy
variables:
DEPENDENCIES: dbus-x11 diffutils gcc gjs meson ninja-build python3-dbus python3-gobject redhat-rpm-config
CPPCHECK_OPTIONS: "--enable=warning --enable=style --enable=performance --enable=portability --std=c99 --template='{id}:{file}:{line},{severity},{message}'"
fedora:Werror:
image: fedora:latest
stage: build
before_script:
- dnf upgrade -y
- dnf install -y 'dnf-command(builddep)'
- dnf builddep -y libsecret
- dnf install -y $DEPENDENCIES
- dbus-uuidgen --ensure
script:
- meson _build -Dwerror=true -Dc_args=-Wno-error=deprecated-declarations
- eval `dbus-launch --sh-syntax`
- meson test -C _build
artifacts:
when: on_failure
paths:
- _build/meson-logs/testlog.txt
fedora:asan:
image: fedora:latest
stage: build
before_script:
- dnf upgrade -y
- dnf install -y 'dnf-command(builddep)'
- dnf builddep -y libsecret
- dnf install -y $DEPENDENCIES libasan
- dbus-uuidgen --ensure
script:
- meson _build -Dsanitize=address
- eval `dbus-launch --sh-syntax`
- meson test -C _build
artifacts:
when: on_failure
paths:
- _build/meson-logs/testlog.txt
fedora:ubsan:
image: fedora:latest
stage: build
before_script:
- dnf upgrade -y
- dnf install -y 'dnf-command(builddep)'
- dnf builddep -y libsecret
- dnf install -y $DEPENDENCIES libubsan
- dbus-uuidgen --ensure
script:
- meson _build -Dsanitize=undefined
- eval `dbus-launch --sh-syntax`
- meson test -C _build
artifacts:
when: on_failure
paths:
- _build/meson-logs/testlog.txt
fedora-static-analyzers/test:
image: fedora:latest
stage: build
before_script:
- dnf upgrade -y
- dnf install -y 'dnf-command(builddep)'
- dnf builddep -y libsecret
- dnf install -y $DEPENDENCIES clang-analyzer cppcheck
- dbus-uuidgen --ensure
script:
- meson _build
- meson compile -C _build --ninja-args scan-build
- cppcheck --force -q $CPPCHECK_OPTIONS libsecret/ egg/ tool/
artifacts:
when: on_failure
paths:
- _build/meson-logs/testlog.txt
fedora:coverage:
image: fedora:latest
stage: build
before_script:
- dnf upgrade -y
- dnf install -y 'dnf-command(builddep)'
- dnf builddep -y libsecret
- dnf install -y $DEPENDENCIES lcov
- dbus-uuidgen --ensure
script:
- meson _build -Db_coverage=true
- eval `dbus-launch --sh-syntax`
- meson test -C _build
- ninja coverage-html -C _build
coverage: '/^\s+lines.+:\s+([\d.]+\%)\s+/'
artifacts:
name: "libsecret-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: on_success
paths:
- _build/meson-logs/coveragereport/
# https://github.com/linux-test-project/lcov/issues/58
allow_failure: true
pages:
stage: deploy
script:
- mv _build/meson-logs/coveragereport/ public/
artifacts:
when: on_success
paths:
- public
# https://github.com/linux-test-project/lcov/issues/58
allow_failure: true