2018-02-18 14:59:29 +00:00
|
|
|
|
stages:
|
|
|
|
|
- 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-27 23:32:39 +00:00
|
|
|
|
- analysis
|
2018-04-27 17:04:52 +02:00
|
|
|
|
- deploy
|
2022-10-31 02:46:31 +01:00
|
|
|
|
- report
|
2018-02-18 14:59:29 +00:00
|
|
|
|
|
2018-02-22 19:37:16 +01:00
|
|
|
|
cache:
|
|
|
|
|
paths:
|
|
|
|
|
- _ccache/
|
|
|
|
|
|
2018-05-26 20:17:15 +02:00
|
|
|
|
variables:
|
2022-12-31 02:15:13 +05:30
|
|
|
|
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v20"
|
2022-11-24 12:10:07 +00:00
|
|
|
|
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
|
|
|
|
|
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v14"
|
2022-12-31 02:15:13 +05:30
|
|
|
|
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v10"
|
2022-10-20 03:16:30 +02:00
|
|
|
|
MESON_TEST_TIMEOUT_MULTIPLIER: 4
|
2018-08-16 14:31:55 -04:00
|
|
|
|
G_MESSAGES_DEBUG: all
|
2022-05-05 19:24:30 +01:00
|
|
|
|
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
|
2018-05-26 20:17:15 +02:00
|
|
|
|
|
2019-11-28 11:38:25 +00:00
|
|
|
|
.only-default:
|
2019-11-27 11:06:32 +00:00
|
|
|
|
only:
|
|
|
|
|
- branches
|
|
|
|
|
except:
|
|
|
|
|
- tags
|
|
|
|
|
|
2022-02-20 12:44:45 +00:00
|
|
|
|
# Some jobs run on CI runners which don’t have good isolation between CI jobs,
|
|
|
|
|
# and don’t have much available resource. Limit those jobs to only ones on the
|
|
|
|
|
# origin repository (GNOME/glib), rather than people’s forks. Code in the origin
|
|
|
|
|
# repository can be trusted.
|
|
|
|
|
.only-origin:
|
|
|
|
|
only:
|
|
|
|
|
- branches@GNOME/glib
|
|
|
|
|
except:
|
|
|
|
|
- tags
|
|
|
|
|
|
2020-07-27 11:54:58 +01:00
|
|
|
|
# Some jobs take a long time and are unlikely to find failures (or will find
|
|
|
|
|
# failures which are not merge-blockers to fix), so they’re executed on a weekly
|
|
|
|
|
# schedule in order to save CI resources and speed up branch pipelines.
|
2022-02-20 12:30:19 +00:00
|
|
|
|
.only-schedules:
|
2020-07-27 11:54:58 +01:00
|
|
|
|
only:
|
|
|
|
|
- schedules
|
2022-02-20 12:30:19 +00:00
|
|
|
|
except:
|
|
|
|
|
- tags
|
|
|
|
|
|
2022-02-20 12:33:09 +00:00
|
|
|
|
.build-linux:
|
2022-02-20 12:30:19 +00:00
|
|
|
|
before_script:
|
|
|
|
|
- bash .gitlab-ci/show-execution-environment.sh
|
|
|
|
|
- cp -r $HOME/subprojects/* subprojects/
|
2020-07-27 11:54:58 +01:00
|
|
|
|
|
2019-11-15 11:59:00 +01:00
|
|
|
|
installed-tests:
|
2022-02-20 12:30:19 +00:00
|
|
|
|
extends:
|
2022-02-20 12:33:09 +00:00
|
|
|
|
- .build-linux
|
2022-02-20 12:30:19 +00:00
|
|
|
|
- .only-schedules
|
2020-01-13 12:45:00 -05:00
|
|
|
|
image: $FEDORA_IMAGE
|
2019-11-15 11:59:00 +01:00
|
|
|
|
stage: build
|
2020-07-27 12:00:57 +01:00
|
|
|
|
needs: []
|
2019-11-15 11:59:00 +01:00
|
|
|
|
script:
|
|
|
|
|
# dtrace is disabled because it breaks the static-link.py test
|
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
|
--werror
|
|
|
|
|
--prefix=/usr --libdir=/usr/lib64
|
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
|
-Ddefault_library=both
|
|
|
|
|
-Ddtrace=false
|
|
|
|
|
_build
|
|
|
|
|
- ninja -C _build
|
|
|
|
|
- sudo ninja -C _build install
|
2019-01-17 10:38:20 +04:00
|
|
|
|
# Remove old headers, possibly present in current installation
|
|
|
|
|
- sudo rm -f /usr/include/glib-2.0/glib/gurifuncs.h
|
2019-12-11 17:52:24 +01:00
|
|
|
|
- sudo chown -R `id -un`:`id -gn` _build/
|
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/
|
2020-02-24 11:06:00 +00:00
|
|
|
|
--parallel=0
|
2019-11-15 11:59:00 +01:00
|
|
|
|
glib
|
|
|
|
|
artifacts:
|
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
|
when: always
|
2022-04-06 12:54:54 +01:00
|
|
|
|
expire_in: 1 week
|
2019-11-15 11:59:00 +01:00
|
|
|
|
paths:
|
|
|
|
|
- "_build/config.h"
|
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
|
- "_build/meson-logs"
|
|
|
|
|
- "_build/installed-tests-report/"
|
|
|
|
|
|
2019-03-05 11:02:24 +00:00
|
|
|
|
G_DISABLE_ASSERT:
|
2022-02-20 12:30:19 +00:00
|
|
|
|
extends:
|
2022-02-20 12:33:09 +00:00
|
|
|
|
- .build-linux
|
2022-02-20 12:30:19 +00:00
|
|
|
|
- .only-schedules
|
2020-01-13 12:45:00 -05:00
|
|
|
|
image: $FEDORA_IMAGE
|
2019-03-05 11:02:24 +00:00
|
|
|
|
stage: build
|
2020-07-27 12:00:57 +01:00
|
|
|
|
needs: []
|
2019-03-05 11:02:24 +00:00
|
|
|
|
script:
|
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
|
--werror
|
|
|
|
|
-Dsystemtap=true
|
|
|
|
|
-Ddtrace=true
|
|
|
|
|
-Dinstalled_tests=true
|
2020-04-08 15:14:31 -04:00
|
|
|
|
-Dglib_assert=false
|
2019-03-05 11:02:24 +00:00
|
|
|
|
_build
|
|
|
|
|
- ninja -C _build
|
2019-04-05 20:53:11 +01:00
|
|
|
|
- bash -x ./.gitlab-ci/run-tests.sh
|
2019-03-05 11:02:24 +00:00
|
|
|
|
artifacts:
|
2019-04-05 20:53:11 +01:00
|
|
|
|
reports:
|
2022-10-19 20:08:15 +02:00
|
|
|
|
junit:
|
|
|
|
|
- _build/meson-logs/testlog.junit.xml
|
|
|
|
|
- _build/meson-logs/testlog-*.junit.xml
|
2019-03-05 11:02:24 +00:00
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
|
when: always
|
2022-04-06 12:54:54 +01:00
|
|
|
|
expire_in: 1 week
|
2019-03-05 11:02:24 +00:00
|
|
|
|
paths:
|
|
|
|
|
- "_build/config.h"
|
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
|
- "_build/meson-logs"
|
|
|
|
|
|
2018-06-26 17:23:09 +01:00
|
|
|
|
valgrind:
|
2022-02-20 12:30:19 +00:00
|
|
|
|
extends:
|
2022-02-20 12:33:09 +00:00
|
|
|
|
- .build-linux
|
2022-02-20 12:30:19 +00:00
|
|
|
|
- .only-schedules
|
2020-01-13 12:45:00 -05:00
|
|
|
|
image: $FEDORA_IMAGE
|
2018-06-26 17:23:09 +01:00
|
|
|
|
stage: analysis
|
2020-07-27 12:00:57 +01:00
|
|
|
|
needs: []
|
2018-06-26 17:23:09 +01:00
|
|
|
|
variables:
|
2022-09-02 20:41:40 +02:00
|
|
|
|
MESON_TEST_TIMEOUT_MULTIPLIER: 15
|
2018-06-26 17:23:09 +01:00
|
|
|
|
script:
|
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
|
--werror
|
|
|
|
|
-Dsystemtap=true
|
|
|
|
|
-Ddtrace=true
|
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
|
_build
|
|
|
|
|
- ninja -C _build
|
2022-06-01 14:48:34 +01:00
|
|
|
|
# Valgrind doesn’t work when the soft FD limit is set too high
|
|
|
|
|
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2710
|
|
|
|
|
- ulimit -Sn 1024
|
2018-06-26 17:23:09 +01:00
|
|
|
|
- bash -x ./.gitlab-ci/run-tests.sh
|
2022-06-16 11:01:04 +01:00
|
|
|
|
--setup valgrind
|
2018-06-26 17:23:09 +01:00
|
|
|
|
--no-suite slow
|
|
|
|
|
artifacts:
|
|
|
|
|
reports:
|
2022-05-25 15:27:08 +02:00
|
|
|
|
junit: "_build/meson-logs/testlog-valgrind.junit.xml"
|
2018-06-26 17:23:09 +01:00
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
|
when: always
|
2022-04-06 12:54:54 +01:00
|
|
|
|
expire_in: 1 week
|
2018-06-26 17:23:09 +01:00
|
|
|
|
paths:
|
|
|
|
|
- "_build/config.h"
|
|
|
|
|
- "_build/glib/glibconfig.h"
|
|
|
|
|
- "_build/meson-logs"
|
|
|
|
|
|
2022-02-20 12:34:20 +00:00
|
|
|
|
.cross-build-linux:
|
2022-02-20 12:33:09 +00:00
|
|
|
|
extends: .build-linux
|
2018-05-20 00:14:56 -04:00
|
|
|
|
stage: build
|
2020-07-27 12:00:57 +01:00
|
|
|
|
needs: []
|
2018-05-20 00:14:56 -04:00
|
|
|
|
artifacts:
|
2018-06-05 14:01:53 -04:00
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
|
when: always
|
2022-04-06 12:54:54 +01:00
|
|
|
|
expire_in: 1 week
|
2018-05-20 00:14:56 -04:00
|
|
|
|
paths:
|
2018-06-05 14:01:53 -04:00
|
|
|
|
- "_build/meson-logs"
|
2018-05-20 00:14:56 -04:00
|
|
|
|
|
2019-12-10 12:45:51 +00:00
|
|
|
|
|
2021-02-12 19:41:11 +00:00
|
|
|
|
macos:
|
2022-02-20 12:44:45 +00:00
|
|
|
|
extends: .only-origin
|
2019-12-10 12:45:51 +00:00
|
|
|
|
stage: build
|
|
|
|
|
tags:
|
|
|
|
|
- macos
|
2020-07-27 12:00:57 +01:00
|
|
|
|
needs: []
|
2022-06-30 01:31:02 +01:00
|
|
|
|
variables:
|
|
|
|
|
GIT_SUBMODULE_STRATEGY: normal
|
2023-04-21 14:50:28 +02:00
|
|
|
|
GIT_STRATEGY: clone
|
2022-07-12 14:16:23 +01:00
|
|
|
|
# libpcre2 gets built as a subproject, but the default Clang options on
|
|
|
|
|
# macOS limit string lengths to 4095B — pcre2_error.c has a string of length
|
|
|
|
|
# 4380B
|
|
|
|
|
CFLAGS: '-Wno-overlength-strings'
|
2019-12-10 12:45:51 +00:00
|
|
|
|
before_script:
|
2020-02-12 14:35:54 +00:00
|
|
|
|
- bash .gitlab-ci/show-execution-environment.sh
|
2023-02-16 13:29:54 +00:00
|
|
|
|
- pip3 install --user meson==1.0.0
|
2019-12-10 12:45:51 +00:00
|
|
|
|
- pip3 install --user ninja
|
|
|
|
|
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
|
|
|
|
script:
|
2020-01-20 15:30:44 +00:00
|
|
|
|
# FIXME: Use --wrap-mode=default so we download dependencies each time,
|
|
|
|
|
# until the macOS runner is a VM where we can use a pre-made image which
|
|
|
|
|
# already contains the dependencies. See:
|
|
|
|
|
# - https://gitlab.gnome.org/GNOME/glib/merge_requests/388
|
|
|
|
|
# - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225
|
2019-12-10 12:45:51 +00:00
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
2020-01-20 15:30:44 +00:00
|
|
|
|
--wrap-mode=default
|
2021-11-17 15:43:59 +00:00
|
|
|
|
--werror
|
2019-12-10 12:45:51 +00:00
|
|
|
|
_build
|
2023-04-21 15:02:58 +02:00
|
|
|
|
# - ninja -C _build
|
2022-02-17 23:01:35 +00:00
|
|
|
|
- .gitlab-ci/run-tests.sh
|
2019-06-24 22:55:36 +08:00
|
|
|
|
artifacts:
|
2019-04-05 20:53:11 +01:00
|
|
|
|
reports:
|
2022-10-19 20:08:15 +02:00
|
|
|
|
junit:
|
|
|
|
|
- _build/meson-logs/testlog.junit.xml
|
|
|
|
|
- _build/meson-logs/testlog-*.junit.xml
|
2018-05-24 23:14:25 +08:00
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
|
when: always
|
2022-04-06 12:54:54 +01:00
|
|
|
|
expire_in: 1 week
|
2018-05-24 23:14:25 +08:00
|
|
|
|
paths:
|
2018-09-29 01:01:12 +08:00
|
|
|
|
- "_build/config.h"
|
|
|
|
|
- "_build/glib/glibconfig.h"
|
2018-05-24 23:14:25 +08:00
|
|
|
|
- "_build/meson-logs"
|
|
|
|
|
|
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-27 23:32:39 +00:00
|
|
|
|
scan-build:
|
2022-02-20 12:30:19 +00:00
|
|
|
|
extends:
|
2022-02-20 12:33:09 +00:00
|
|
|
|
- .build-linux
|
2022-02-20 12:30:19 +00:00
|
|
|
|
- .only-schedules
|
2020-01-13 12:45:00 -05:00
|
|
|
|
image: $FEDORA_IMAGE
|
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-27 23:32:39 +00:00
|
|
|
|
stage: analysis
|
2020-07-27 12:00:57 +01:00
|
|
|
|
needs: []
|
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-27 23:32:39 +00:00
|
|
|
|
script:
|
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
|
--werror
|
|
|
|
|
--default-library=both
|
|
|
|
|
--prefix=$HOME/glib-installed
|
2021-02-24 13:16:57 +00:00
|
|
|
|
--localstatedir=/var
|
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-27 23:32:39 +00:00
|
|
|
|
--libdir=lib
|
|
|
|
|
-Dsystemtap=true
|
|
|
|
|
-Ddtrace=true
|
|
|
|
|
-Dinstalled_tests=true
|
2019-06-12 14:31:42 +01: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-27 23:32:39 +00:00
|
|
|
|
artifacts:
|
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
|
when: always
|
2022-04-06 12:54:54 +01:00
|
|
|
|
expire_in: 1 week
|
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-27 23:32:39 +00:00
|
|
|
|
paths:
|
2019-06-12 14:31:42 +01: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-27 23:32:39 +00:00
|
|
|
|
|
2020-07-27 12:39:24 +01:00
|
|
|
|
coverity:
|
2022-02-20 12:30:19 +00:00
|
|
|
|
extends:
|
2022-02-20 12:33:09 +00:00
|
|
|
|
- .build-linux
|
2022-02-20 12:30:19 +00:00
|
|
|
|
- .only-schedules
|
2020-07-27 12:39:24 +01:00
|
|
|
|
image: $COVERITY_IMAGE
|
|
|
|
|
stage: analysis
|
|
|
|
|
needs: []
|
|
|
|
|
variables:
|
|
|
|
|
# cov-build doesn’t like GLIB_DEPRECATED_ENUMERATOR
|
|
|
|
|
CFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
|
|
|
|
|
script:
|
|
|
|
|
- meson ${MESON_COMMON_OPTIONS}
|
|
|
|
|
--werror
|
|
|
|
|
--default-library=both
|
|
|
|
|
--prefix=$HOME/glib-installed
|
2021-02-24 13:16:57 +00:00
|
|
|
|
--localstatedir=/var
|
2020-07-27 12:39:24 +01:00
|
|
|
|
--libdir=lib
|
|
|
|
|
-Dsystemtap=true
|
|
|
|
|
-Ddtrace=true
|
|
|
|
|
-Dinstalled_tests=true
|
|
|
|
|
_coverity_build
|
|
|
|
|
- $HOME/cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C _coverity_build
|
|
|
|
|
- tar cfz cov-int.tar.gz cov-int
|
|
|
|
|
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
|
|
|
|
|
--form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
|
|
|
|
|
--form file=@cov-int.tar.gz --form version="$CI_COMMIT_SHA"
|
|
|
|
|
--form description="$CI_COMMIT_SHA / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
|
|
|
|
|
artifacts:
|
|
|
|
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
|
|
|
|
when: always
|
2022-04-06 12:54:54 +01:00
|
|
|
|
expire_in: 1 week
|
2020-07-27 12:39:24 +01:00
|
|
|
|
paths:
|
|
|
|
|
- "cov-int/build-log.txt"
|
|
|
|
|
|
2018-02-18 14:59:29 +00:00
|
|
|
|
dist-job:
|
2020-01-13 12:45:00 -05:00
|
|
|
|
image: $FEDORA_IMAGE
|
2018-02-18 14:59:29 +00:00
|
|
|
|
stage: build
|
|
|
|
|
only:
|
|
|
|
|
- tags
|
|
|
|
|
script:
|
2022-07-12 19:57:17 +02:00
|
|
|
|
# Ignore extra git security checks as we don't care in CI.
|
|
|
|
|
- git config --global --add safe.directory "${PWD}"
|
|
|
|
|
- git submodule update --init
|
|
|
|
|
- for m in $(git submodule foreach -q 'echo $path'); do git config --global --add safe.directory "${PWD}/${m}"; done
|
|
|
|
|
- meson subprojects download
|
2022-05-05 19:24:30 +01:00
|
|
|
|
- meson ${MESON_COMMON_OPTIONS} --buildtype release -Dgtk_doc=true -Dman=true _build
|
2018-02-18 14:59:29 +00:00
|
|
|
|
- cd _build
|
|
|
|
|
- ninja dist
|
2018-06-18 09:47:39 -04:00
|
|
|
|
- ninja glib-doc gobject-doc gio-doc
|
2020-04-28 14:36:29 +02:00
|
|
|
|
- tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
|
|
|
|
|
- tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
|
|
|
|
|
- tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
|
2018-02-18 14:59:29 +00:00
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
2020-04-28 13:28:50 +02:00
|
|
|
|
- "${CI_PROJECT_DIR}/_build/glib-docs-$CI_COMMIT_TAG.tar.xz"
|
|
|
|
|
- "${CI_PROJECT_DIR}/_build/gobject-docs-$CI_COMMIT_TAG.tar.xz"
|
|
|
|
|
- "${CI_PROJECT_DIR}/_build/gio-docs-$CI_COMMIT_TAG.tar.xz"
|
2018-02-18 14:59:29 +00:00
|
|
|
|
- "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"
|
2022-10-31 02:46:31 +01:00
|
|
|
|
|
|
|
|
|
issue-bot:
|
|
|
|
|
stage: report
|
|
|
|
|
image: registry.gitlab.com/gitlab-org/distribution/issue-bot:latest
|
|
|
|
|
script: /issue-bot
|
|
|
|
|
rules:
|
|
|
|
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"
|
|
|
|
|
when: on_failure
|