2018-02-18 15:59:29 +01:00
|
|
|
stages:
|
2019-11-26 13:17:42 +01:00
|
|
|
- style-check
|
2018-02-18 15:59:29 +01:00
|
|
|
- build
|
2018-04-27 17:04:52 +02:00
|
|
|
- coverage
|
ci: Add scan-build job in a new ‘analysis’ pipeline stage
Use Meson’s support for running scan-build (Clang’s static analyser)
against the build, so that we get static analysis of each pipeline. Add
it in a new pipeline stage, after code coverage, so that we don’t waste
resources on it unless the unit tests pass — a static analysis build
takes perhaps 10× as long as a normal GCC build.
https://mesonbuild.com/howtox.html#use-clang-static-analyzer
Currently, the static analysis results are uploaded as artifacts, but
the job will always succeed (regardless of whether there are any bugs
found in the analysis).
Currently, a large number of reports are outputted by the analyser,
which need to be fixed before we can gate the pipeline on it.
Furthermore, in order to get scan-build to exit with a non-zero status
if any bugs are found, we need to depend on Meson ≥ 0.49.0, which
contains the fix https://github.com/mesonbuild/meson/issues/4334,
allowing us to add the following to .gitlab-ci.yml:
```
variables:
# Exit with a non-zero status if any bugs are found
SCANBUILD: "scan-build --status-bugs"
```
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-28 00:32:39 +01:00
|
|
|
- analysis
|
2018-04-27 17:04:52 +02:00
|
|
|
- deploy
|
2018-02-18 15:59:29 +01:00
|
|
|
|
2018-02-22 19:37:16 +01:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- _ccache/
|
|
|
|
|
2018-05-26 20:17:15 +02:00
|
|
|
variables:
|
|
|
|
MESON_TEST_TIMEOUT_MULTIPLIER: 2
|
2018-08-16 20:31:55 +02:00
|
|
|
G_MESSAGES_DEBUG: all
|
2018-09-24 16:19:18 +02:00
|
|
|
MESON_COMMON_OPTIONS: "--buildtype debug --fatal-meson-warnings"
|
2018-05-26 20:17:15 +02:00
|
|
|
|
2019-11-28 12:38:25 +01:00
|
|
|
.only-default:
|
2019-11-27 12:06:32 +01:00
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
except:
|
|
|
|
- tags
|
|
|
|
|
2019-11-11 21:21:25 +01:00
|
|
|
style-check-diff:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2019-11-11 21:21:25 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/debian-stable:v5
|
|
|
|
stage: style-check
|
|
|
|
allow_failure: true
|
|
|
|
script:
|
2019-11-28 12:44:24 +01:00
|
|
|
- .gitlab-ci/run-style-check-diff.sh
|
2019-11-11 21:21:25 +01:00
|
|
|
|
2018-06-22 17:08:06 +02:00
|
|
|
fedora-x86_64:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2019-11-27 14:22:26 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
2018-02-18 15:59:29 +01:00
|
|
|
stage: build
|
2018-04-27 17:04:52 +02:00
|
|
|
variables:
|
2018-06-05 19:58:48 +02:00
|
|
|
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
|
2018-02-18 15:59:29 +01:00
|
|
|
script:
|
2018-09-26 16:56:10 +02:00
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
--werror
|
|
|
|
--default-library=both
|
|
|
|
--prefix=$HOME/glib-installed
|
|
|
|
--libdir=lib
|
|
|
|
-Dsystemtap=true
|
|
|
|
-Ddtrace=true
|
|
|
|
-Dfam=true
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
_build
|
2018-06-05 19:58:48 +02:00
|
|
|
- ninja -C _build
|
2018-04-27 17:04:52 +02:00
|
|
|
- mkdir -p _coverage
|
2018-10-03 15:47:26 +02:00
|
|
|
- lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
|
2019-04-05 21:53:11 +02:00
|
|
|
- .gitlab-ci/run-tests.sh
|
2018-10-03 15:47:26 +02:00
|
|
|
- lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
|
2018-02-18 15:59:29 +01:00
|
|
|
artifacts:
|
2019-04-05 21:53:11 +02:00
|
|
|
reports:
|
|
|
|
junit: "_build/${CI_JOB_NAME}-report.xml"
|
2018-05-29 11:54:29 +02:00
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
2018-05-29 11:53:41 +02:00
|
|
|
when: always
|
2018-02-18 15:59:29 +01:00
|
|
|
paths:
|
2018-08-29 12:16:58 +02:00
|
|
|
- "_build/config.h"
|
|
|
|
- "_build/glib/glibconfig.h"
|
2018-06-05 20:01:53 +02:00
|
|
|
- "_build/meson-logs"
|
2019-04-05 21:53:11 +02:00
|
|
|
- "_build/${CI_JOB_NAME}-report.xml"
|
2018-06-05 20:01:53 +02:00
|
|
|
- "_coverage"
|
2018-02-18 15:59:29 +01:00
|
|
|
|
2019-04-30 15:01:56 +02:00
|
|
|
debian-stable-x86_64:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2019-11-25 11:51:14 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/debian-stable:v5
|
2019-04-30 15:01:56 +02:00
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
--werror
|
|
|
|
--default-library=both
|
|
|
|
--prefix=$HOME/glib-installed
|
|
|
|
--libdir=lib
|
|
|
|
-Dsystemtap=true
|
|
|
|
-Ddtrace=true
|
|
|
|
-Dfam=true
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
_build
|
|
|
|
- ninja -C _build
|
|
|
|
- .gitlab-ci/run-tests.sh
|
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
junit: "_build/${CI_JOB_NAME}-report.xml"
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- "_build/config.h"
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
- "_build/meson-logs"
|
|
|
|
- "_build/${CI_JOB_NAME}-report.xml"
|
|
|
|
|
2019-11-15 11:59:00 +01:00
|
|
|
installed-tests:
|
|
|
|
extends: .only-default
|
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
# dtrace is disabled because it breaks the static-link.py test
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
--werror
|
|
|
|
--prefix=/usr --libdir=/usr/lib64
|
|
|
|
-Dfam=true
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
-Ddefault_library=both
|
|
|
|
-Ddtrace=false
|
|
|
|
_build
|
|
|
|
- ninja -C _build
|
|
|
|
- sudo ninja -C _build install
|
2019-11-28 15:21:33 +01:00
|
|
|
# FIXME: Add update until stable https://bodhi.fedoraproject.org/updates/FEDORA-2019-161b129d4d
|
|
|
|
- sudo dnf upgrade -y --enablerepo=updates-testing --advisory=FEDORA-2019-161b129d4d
|
2019-12-04 14:33:47 +01:00
|
|
|
# Work-around https://gitlab.gnome.org/GNOME/gnome-desktop-testing/merge_requests/2
|
|
|
|
- mkdir -p _build/installed-tests-report/logs/
|
2019-11-28 14:30:23 +01:00
|
|
|
- GLIB_TEST_COMPILATION=1 gnome-desktop-testing-runner
|
2019-11-15 11:59:00 +01:00
|
|
|
--report-directory=_build/installed-tests-report/failed/
|
2019-11-28 15:21:33 +01:00
|
|
|
--log-directory=_build/installed-tests-report/logs/
|
2019-11-15 11:59:00 +01:00
|
|
|
glib
|
|
|
|
artifacts:
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- "_build/config.h"
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
- "_build/meson-logs"
|
|
|
|
- "_build/installed-tests-report/"
|
|
|
|
|
2019-03-05 12:02:24 +01:00
|
|
|
G_DISABLE_ASSERT:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2019-11-27 14:22:26 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
2019-03-05 12:02:24 +01:00
|
|
|
stage: build
|
|
|
|
variables:
|
|
|
|
CPPFLAGS: "-DG_DISABLE_ASSERT"
|
|
|
|
script:
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
--werror
|
|
|
|
-Dsystemtap=true
|
|
|
|
-Ddtrace=true
|
|
|
|
-Dfam=true
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
_build
|
|
|
|
- ninja -C _build
|
2019-04-05 21:53:11 +02:00
|
|
|
- bash -x ./.gitlab-ci/run-tests.sh
|
2019-03-05 12:02:24 +01:00
|
|
|
artifacts:
|
2019-04-05 21:53:11 +02:00
|
|
|
reports:
|
|
|
|
junit: "_build/${CI_JOB_NAME}-report.xml"
|
2019-03-05 12:02:24 +01:00
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- "_build/config.h"
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
- "_build/meson-logs"
|
2019-04-05 21:53:11 +02:00
|
|
|
- "_build/${CI_JOB_NAME}-report.xml"
|
2019-03-05 12:02:24 +01:00
|
|
|
|
2018-06-26 18:23:09 +02:00
|
|
|
valgrind:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2019-11-27 14:22:26 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
2018-06-26 18:23:09 +02:00
|
|
|
stage: analysis
|
|
|
|
variables:
|
|
|
|
MESON_TEST_TIMEOUT_MULTIPLIER: 10
|
|
|
|
script:
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
--werror
|
|
|
|
-Dsystemtap=true
|
|
|
|
-Ddtrace=true
|
|
|
|
-Dfam=true
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
_build
|
|
|
|
- ninja -C _build
|
|
|
|
- bash -x ./.gitlab-ci/run-tests.sh
|
|
|
|
--log-file _build/meson-logs/testlog-valgrind.json
|
|
|
|
--wrap "valgrind --tool=memcheck --error-exitcode=1 --track-origins=yes --leak-check=full --leak-resolution=high --num-callers=50 --show-leak-kinds=definite,possible --show-error-list=yes --suppressions=${CI_PROJECT_DIR}/glib.supp"
|
|
|
|
--no-suite no-valgrind
|
|
|
|
--no-suite slow
|
|
|
|
# FIXME: Remove this when we have zero valgrind leaks.
|
|
|
|
# https://gitlab.gnome.org/GNOME/glib/issues/333
|
|
|
|
allow_failure: true
|
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
junit: "_build/${CI_JOB_NAME}-report.xml"
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- "_build/config.h"
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
- "_build/meson-logs"
|
|
|
|
|
2018-06-27 15:14:38 +02:00
|
|
|
.cross-template: &cross-template
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2018-05-20 06:14:56 +02:00
|
|
|
stage: build
|
|
|
|
artifacts:
|
2018-06-05 20:01:53 +02:00
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
2018-05-20 06:14:56 +02:00
|
|
|
paths:
|
2018-06-05 20:01:53 +02:00
|
|
|
- "_build/meson-logs"
|
2018-05-20 06:14:56 +02:00
|
|
|
|
2018-06-27 15:14:38 +02:00
|
|
|
cross-android_api21_arm64:
|
|
|
|
<<: *cross-template
|
2019-04-30 15:01:28 +02:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/android-ndk:v1
|
2018-06-27 15:14:38 +02:00
|
|
|
script:
|
|
|
|
# FIXME: add --werror
|
2019-04-04 01:55:58 +02:00
|
|
|
# We use -Diconv=auto to test that we successfully detect that iconv is not
|
|
|
|
# provided by android api 21, and detect the external iconv instead.
|
|
|
|
- meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_android_arm64_21.txt -Diconv=auto -Dinternal_pcre=true _build
|
2018-06-27 15:14:38 +02:00
|
|
|
- ninja -C _build
|
|
|
|
|
2018-06-26 19:18:29 +02:00
|
|
|
cross-android_api28_arm64:
|
|
|
|
<<: *cross-template
|
2019-04-30 15:01:28 +02:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/android-ndk:v1
|
2018-06-26 19:18:29 +02:00
|
|
|
script:
|
|
|
|
# FIXME: add --werror
|
2018-09-24 16:19:18 +02:00
|
|
|
- meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_android_arm64_28.txt -Dinternal_pcre=true _build
|
2018-06-26 19:18:29 +02:00
|
|
|
- ninja -C _build
|
|
|
|
|
2018-06-22 17:08:06 +02:00
|
|
|
cross-mingw64:
|
2018-06-27 15:14:38 +02:00
|
|
|
<<: *cross-template
|
2019-04-30 15:01:28 +02:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/mingw:v1
|
2018-05-20 21:17:48 +02:00
|
|
|
script:
|
|
|
|
# FIXME: Add --werror
|
2018-09-24 16:19:18 +02:00
|
|
|
- meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_mingw64.txt _build
|
2018-05-20 21:17:48 +02:00
|
|
|
- ninja -C _build
|
|
|
|
|
2018-02-22 19:37:16 +01:00
|
|
|
msys2-mingw32:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2018-02-22 19:37:16 +01:00
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- win32
|
|
|
|
variables:
|
|
|
|
MSYSTEM: "MINGW32"
|
|
|
|
CHERE_INVOKING: "yes"
|
|
|
|
script:
|
|
|
|
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
|
|
|
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
|
2018-04-27 17:04:52 +02:00
|
|
|
artifacts:
|
2019-04-06 16:22:04 +02:00
|
|
|
reports:
|
|
|
|
junit: "_build/%CI_JOB_NAME%-report.xml"
|
2018-05-29 11:54:29 +02:00
|
|
|
name: "glib-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%"
|
2018-05-28 14:11:22 +02:00
|
|
|
when: always
|
2018-04-27 17:04:52 +02:00
|
|
|
paths:
|
2018-05-28 14:11:22 +02:00
|
|
|
- _build/meson-logs
|
2019-04-06 16:22:04 +02:00
|
|
|
- "_build/%CI_JOB_NAME%-report.xml"
|
2018-04-27 17:04:52 +02:00
|
|
|
- _coverage/
|
|
|
|
|
2018-05-24 19:18:25 +02:00
|
|
|
vs2017-x64:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2018-05-24 19:18:25 +02:00
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- win32
|
|
|
|
script:
|
|
|
|
- .gitlab-ci/test-msvc.bat
|
|
|
|
artifacts:
|
2019-04-08 10:51:47 +02:00
|
|
|
reports:
|
|
|
|
junit: "_build/%CI_JOB_NAME%-report.xml"
|
2018-05-29 11:54:29 +02:00
|
|
|
name: "glib-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%"
|
2018-05-24 19:18:25 +02:00
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- _build/meson-logs
|
2019-04-08 10:51:47 +02:00
|
|
|
- "_build/%CI_JOB_NAME%-report.xml"
|
2018-05-24 19:18:25 +02:00
|
|
|
|
2018-05-24 17:14:25 +02:00
|
|
|
freebsd-11-x86_64:
|
|
|
|
stage: build
|
2018-10-09 16:54:48 +02:00
|
|
|
only:
|
|
|
|
- branches@GNOME/glib
|
2018-05-24 17:14:25 +02:00
|
|
|
tags:
|
|
|
|
# To run a FreeBSD builder, install gitlab-runner package and start both
|
|
|
|
# gitlab-runner and dbus service because we need /var/lib/dbus/machine-id.
|
|
|
|
# To compile GLib, you still have to install the following packages:
|
|
|
|
# desktop-file-utils gettext libiconv meson pkgconf python3 shared-mime-info
|
|
|
|
- freebsd-11
|
|
|
|
variables:
|
|
|
|
# CPPFLAGS is required because libintl doesn't use pkg-config.
|
|
|
|
CPPFLAGS: -I/usr/local/include
|
|
|
|
# FIXME: Workaround meson inability to set LD_LIBRARY_PATH.
|
|
|
|
# https://github.com/mesonbuild/meson/issues/1383
|
|
|
|
# https://github.com/mesonbuild/meson/issues/1635
|
|
|
|
# https://github.com/mesonbuild/meson/issues/2881
|
|
|
|
LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
|
|
|
|
# FreeBSD doesn't have C.UTF-8 locale.
|
|
|
|
LANG: en_US.UTF-8
|
|
|
|
script:
|
|
|
|
# We cannot use -Wl,--no-undefined because GLib uses 'environ' variable.
|
2019-04-04 01:55:58 +02:00
|
|
|
# FreeBSD iconv doesn't handle transliteration, so we use (external) GNU libiconv here.
|
2018-05-24 17:14:25 +02:00
|
|
|
# FreeBSD supports xattr, but its API is different from Linux xattr.
|
|
|
|
# FIXME: extattr(2) support: https://gitlab.gnome.org/GNOME/glib/issues/1404
|
2019-04-04 01:55:58 +02:00
|
|
|
- meson ${MESON_COMMON_OPTIONS} -Db_lundef=false -Diconv=external -Dxattr=false _build
|
2018-05-24 17:14:25 +02:00
|
|
|
- ninja -C _build
|
2019-04-05 21:53:11 +02:00
|
|
|
- bash -x ./.gitlab-ci/run-tests.sh
|
2018-05-24 17:14:25 +02:00
|
|
|
artifacts:
|
2019-06-24 16:55:36 +02:00
|
|
|
reports:
|
|
|
|
junit: "_build/${CI_JOB_NAME}-report.xml"
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- "_build/config.h"
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
- "_build/meson-logs"
|
|
|
|
- "_build/${CI_JOB_NAME}-report.xml"
|
|
|
|
|
|
|
|
freebsd-12-x86_64:
|
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- branches@GNOME/glib
|
|
|
|
tags:
|
|
|
|
- freebsd-12
|
|
|
|
variables:
|
|
|
|
CPPFLAGS: -I/usr/local/include
|
|
|
|
LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
|
|
|
|
LANG: en_US.UTF-8
|
|
|
|
script:
|
|
|
|
- meson ${MESON_COMMON_OPTIONS} -Db_lundef=false -Diconv=external -Dxattr=false _build
|
|
|
|
- ninja -C _build
|
|
|
|
- bash -x ./.gitlab-ci/run-tests.sh
|
|
|
|
except:
|
|
|
|
- tags
|
|
|
|
artifacts:
|
2019-04-05 21:53:11 +02:00
|
|
|
reports:
|
|
|
|
junit: "_build/${CI_JOB_NAME}-report.xml"
|
2018-05-24 17:14:25 +02:00
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
|
|
|
paths:
|
2018-09-28 19:01:12 +02:00
|
|
|
- "_build/config.h"
|
|
|
|
- "_build/glib/glibconfig.h"
|
2018-05-24 17:14:25 +02:00
|
|
|
- "_build/meson-logs"
|
2019-04-05 21:53:11 +02:00
|
|
|
- "_build/${CI_JOB_NAME}-report.xml"
|
2018-05-24 17:14:25 +02:00
|
|
|
|
2018-04-27 17:04:52 +02:00
|
|
|
coverage:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2019-11-27 14:22:26 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
2018-04-27 17:04:52 +02:00
|
|
|
stage: coverage
|
|
|
|
artifacts:
|
2018-05-29 11:54:29 +02:00
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
2018-04-27 17:04:52 +02:00
|
|
|
paths:
|
|
|
|
- _coverage/
|
|
|
|
script:
|
|
|
|
- bash -x ./.gitlab-ci/coverage-docker.sh
|
2018-05-25 00:43:03 +02:00
|
|
|
coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
|
2018-04-27 17:04:52 +02:00
|
|
|
|
ci: Add scan-build job in a new ‘analysis’ pipeline stage
Use Meson’s support for running scan-build (Clang’s static analyser)
against the build, so that we get static analysis of each pipeline. Add
it in a new pipeline stage, after code coverage, so that we don’t waste
resources on it unless the unit tests pass — a static analysis build
takes perhaps 10× as long as a normal GCC build.
https://mesonbuild.com/howtox.html#use-clang-static-analyzer
Currently, the static analysis results are uploaded as artifacts, but
the job will always succeed (regardless of whether there are any bugs
found in the analysis).
Currently, a large number of reports are outputted by the analyser,
which need to be fixed before we can gate the pipeline on it.
Furthermore, in order to get scan-build to exit with a non-zero status
if any bugs are found, we need to depend on Meson ≥ 0.49.0, which
contains the fix https://github.com/mesonbuild/meson/issues/4334,
allowing us to add the following to .gitlab-ci.yml:
```
variables:
# Exit with a non-zero status if any bugs are found
SCANBUILD: "scan-build --status-bugs"
```
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-28 00:32:39 +01:00
|
|
|
scan-build:
|
2019-11-28 12:38:25 +01:00
|
|
|
extends: .only-default
|
2019-11-27 14:22:26 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
ci: Add scan-build job in a new ‘analysis’ pipeline stage
Use Meson’s support for running scan-build (Clang’s static analyser)
against the build, so that we get static analysis of each pipeline. Add
it in a new pipeline stage, after code coverage, so that we don’t waste
resources on it unless the unit tests pass — a static analysis build
takes perhaps 10× as long as a normal GCC build.
https://mesonbuild.com/howtox.html#use-clang-static-analyzer
Currently, the static analysis results are uploaded as artifacts, but
the job will always succeed (regardless of whether there are any bugs
found in the analysis).
Currently, a large number of reports are outputted by the analyser,
which need to be fixed before we can gate the pipeline on it.
Furthermore, in order to get scan-build to exit with a non-zero status
if any bugs are found, we need to depend on Meson ≥ 0.49.0, which
contains the fix https://github.com/mesonbuild/meson/issues/4334,
allowing us to add the following to .gitlab-ci.yml:
```
variables:
# Exit with a non-zero status if any bugs are found
SCANBUILD: "scan-build --status-bugs"
```
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-28 00:32:39 +01:00
|
|
|
stage: analysis
|
|
|
|
script:
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
--werror
|
|
|
|
--default-library=both
|
|
|
|
--prefix=$HOME/glib-installed
|
|
|
|
--libdir=lib
|
|
|
|
-Dsystemtap=true
|
|
|
|
-Ddtrace=true
|
|
|
|
-Dfam=true
|
|
|
|
-Dinstalled_tests=true
|
2019-06-12 15:31:42 +02:00
|
|
|
_scan_build
|
|
|
|
- ninja -C _scan_build scan-build
|
ci: Add scan-build job in a new ‘analysis’ pipeline stage
Use Meson’s support for running scan-build (Clang’s static analyser)
against the build, so that we get static analysis of each pipeline. Add
it in a new pipeline stage, after code coverage, so that we don’t waste
resources on it unless the unit tests pass — a static analysis build
takes perhaps 10× as long as a normal GCC build.
https://mesonbuild.com/howtox.html#use-clang-static-analyzer
Currently, the static analysis results are uploaded as artifacts, but
the job will always succeed (regardless of whether there are any bugs
found in the analysis).
Currently, a large number of reports are outputted by the analyser,
which need to be fixed before we can gate the pipeline on it.
Furthermore, in order to get scan-build to exit with a non-zero status
if any bugs are found, we need to depend on Meson ≥ 0.49.0, which
contains the fix https://github.com/mesonbuild/meson/issues/4334,
allowing us to add the following to .gitlab-ci.yml:
```
variables:
# Exit with a non-zero status if any bugs are found
SCANBUILD: "scan-build --status-bugs"
```
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-28 00:32:39 +01:00
|
|
|
artifacts:
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
when: always
|
|
|
|
paths:
|
2019-06-12 15:31:42 +02:00
|
|
|
- "_scan_build/meson-logs/scanbuild"
|
ci: Add scan-build job in a new ‘analysis’ pipeline stage
Use Meson’s support for running scan-build (Clang’s static analyser)
against the build, so that we get static analysis of each pipeline. Add
it in a new pipeline stage, after code coverage, so that we don’t waste
resources on it unless the unit tests pass — a static analysis build
takes perhaps 10× as long as a normal GCC build.
https://mesonbuild.com/howtox.html#use-clang-static-analyzer
Currently, the static analysis results are uploaded as artifacts, but
the job will always succeed (regardless of whether there are any bugs
found in the analysis).
Currently, a large number of reports are outputted by the analyser,
which need to be fixed before we can gate the pipeline on it.
Furthermore, in order to get scan-build to exit with a non-zero status
if any bugs are found, we need to depend on Meson ≥ 0.49.0, which
contains the fix https://github.com/mesonbuild/meson/issues/4334,
allowing us to add the following to .gitlab-ci.yml:
```
variables:
# Exit with a non-zero status if any bugs are found
SCANBUILD: "scan-build --status-bugs"
```
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-28 00:32:39 +01:00
|
|
|
|
2018-04-27 17:04:52 +02:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
2018-06-05 19:39:26 +02:00
|
|
|
only:
|
|
|
|
- master
|
2018-04-27 17:04:52 +02:00
|
|
|
script:
|
|
|
|
- mv _coverage/ public/
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
2018-02-22 19:37:16 +01:00
|
|
|
|
2018-02-18 15:59:29 +01:00
|
|
|
dist-job:
|
2019-11-27 14:22:26 +01:00
|
|
|
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
2018-02-18 15:59:29 +01:00
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
2018-09-24 16:19:18 +02:00
|
|
|
- meson --buildtype release --fatal-meson-warnings -Dgtk_doc=true -Dman=true _build
|
2018-02-18 15:59:29 +01:00
|
|
|
- cd _build
|
|
|
|
- ninja dist
|
2018-06-18 15:47:39 +02:00
|
|
|
- ninja glib-doc gobject-doc gio-doc
|
2018-02-18 15:59:29 +01:00
|
|
|
- tar -c -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
|
|
|
|
- tar -c -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
|
|
|
|
- tar -c -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- "${CI_PROJECT_DIR}/_build/glib-docs.tar.xz"
|
|
|
|
- "${CI_PROJECT_DIR}/_build/gobject-docs.tar.xz"
|
|
|
|
- "${CI_PROJECT_DIR}/_build/gio-docs.tar.xz"
|
|
|
|
- "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"
|