mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-28 00:16:15 +01:00
524d96fd92
GitLab can then use this to annotate each pipeline with its code coverage statistics. It can only use one figure, so we choose lines (rather than function or branch coverage) since it’s the most intuitive figure. This parses the ‘lines’ line from output like: Overall coverage rate: lines......: 76.7% (108959 of 142122 lines) functions..: 80.7% (10294 of 12763 functions) branches...: 51.3% (50226 of 97953 branches) Signed-off-by: Philip Withnall <withnall@endlessm.com>
83 lines
2.0 KiB
YAML
83 lines
2.0 KiB
YAML
image: registry.gitlab.gnome.org/gnome/glib/master:v1
|
|
|
|
stages:
|
|
- build
|
|
- coverage
|
|
- deploy
|
|
|
|
cache:
|
|
paths:
|
|
- _ccache/
|
|
|
|
fedora-meson-x86_64:
|
|
stage: build
|
|
variables:
|
|
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
|
|
script:
|
|
- meson --prefix /usr --libdir /usr/lib64 --buildtype debug --werror -Dsystemtap=true -Ddtrace=true _build .
|
|
- cd _build
|
|
- ninja
|
|
- meson test --timeout-multiplier 2
|
|
- cd ..
|
|
- mkdir -p _coverage
|
|
- lcov --rc lcov_branch_coverage=1 --directory . --capture --no-external --output-file "_coverage/${CI_JOB_NAME}.lcov"
|
|
except:
|
|
- tags
|
|
artifacts:
|
|
name: "glib-_${CI_COMMIT_REF_NAME}"
|
|
paths:
|
|
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
|
- "${CI_PROJECT_DIR}/_coverage"
|
|
|
|
msys2-mingw32:
|
|
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"
|
|
artifacts:
|
|
paths:
|
|
- _coverage/
|
|
|
|
coverage:
|
|
stage: coverage
|
|
artifacts:
|
|
paths:
|
|
- _coverage/
|
|
script:
|
|
- bash -x ./.gitlab-ci/coverage-docker.sh
|
|
coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
|
|
|
|
pages:
|
|
stage: deploy
|
|
script:
|
|
- mv _coverage/ public/
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- master
|
|
|
|
dist-job:
|
|
stage: build
|
|
only:
|
|
- tags
|
|
script:
|
|
- meson --prefix /usr --libdir /usr/lib64 --buildtype release -Dgtk_doc=true -Dman=true _build .
|
|
- cd _build
|
|
- ninja dist
|
|
- ninja glib-doc
|
|
- 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"
|