-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy path.gitlab-ci.yml
179 lines (167 loc) · 6.32 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# 2025-01-15: ubuntu:latest = 24.04, ubuntu:rolling = 24.10, ubuntu:devel = 25.04
# See https://hub.docker.com/_/ubuntu
image: ubuntu:rolling
include:
- component: "gitlab.gnome.org/GNOME/citemplates/release-service@master"
inputs:
job-stage: "release"
dist-job-name: "build_release_tarball"
tarball-artifact-path: "_build/meson-dist/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz"
stages:
- build
- deploy
- release
variables:
MESON_DEPS: g++
gettext
git
yelp-tools
gtk-doc-tools
python3-pygments
python3-setuptools
python3-packaging
libglib2.0-dev
mm-common
libsigc++-3.0-dev
libxml-libxml-perl
meson
ninja-build
glib-networking
GLIB_MESON_OPTIONS: -Dglib:tests=false
GIO_EXTRA_MODULES: "/usr/lib/x86_64-linux-gnu/gio/modules"
GIT_SUBMODULE_STRATEGY: normal
.build_default:
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt update && apt -y upgrade && apt -y install $DEPENDENCIES
autotools_build:
extends: .build_default
stage: build
variables:
DEPENDENCIES: $MESON_DEPS make autoconf
script:
# Don't try to build with Autotools if the image's version of glib is too old.
# Meson can build glib as a subproject, but Autotools has no subprojects.
- glib_required=`sed -n '/glibreq=/ s/.*\(2\.[0-9]*\.[0-9]*\).*/\1/p' configure.ac`
- glib_exists=`pkg-config --modversion glib-2.0`
- if test $glib_required '>' $glib_exists; then
- echo GLib $glib_exists exists, $glib_required required. Skip building with Autotools.
- else
- ./autogen.sh --enable-warnings=fatal --prefix=/usr
- make
- make check
- make install
- fi
allow_failure: true
debug_gcc_build:
extends: .build_default
stage: build
variables:
DEPENDENCIES: $MESON_DEPS
script:
- mkdir _build && cd _build
# -Ddebug=true + -Doptimization=0 correspond to -Dbuildtype=debug
# Don't use warning_level and werror. They are applied also to subprojects.
# meson setup --prefix=/usr --libdir=lib -Ddebug=true -Doptimization=0 -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true
- meson setup --prefix=/usr --libdir=lib -Ddebug=true -Doptimization=0 -Dwarnings=fatal $GLIB_MESON_OPTIONS
- meson compile
# Must wrap the command in single quotes because of the colon.
# See https://gitlab.gnome.org/help/ci/yaml/script.md#use-special-characters-with-script
# Don't test subprojects.
- 'meson test --suite glibmm:'
- meson install --quiet
artifacts:
when: on_failure
paths:
- _build/meson-logs/testlog.txt
- _build/meson-logs/meson-log.txt
expire_in: 1 week
release_gcc_build:
extends: .build_default
stage: build
variables:
DEPENDENCIES: $MESON_DEPS wget
script:
# Get libsigc++'s Doxygen tag file. It's published with the reference documentation.
- DOXYTAG_PATH=$(pkg-config --variable=doxytagfile sigc++-3.0)
- DOXYTAG_FILE=$(basename $DOXYTAG_PATH)
- DOXYTAG_DIR=$(dirname $DOXYTAG_PATH)
- mkdir --parents $DOXYTAG_DIR
- wget --timeout=120 --tries=2 --no-clobber --directory-prefix=$DOXYTAG_DIR $(pkg-config --variable=htmlrefpub sigc++-3.0)/$DOXYTAG_FILE || true
- mkdir _build && cd _build
# -Ddebug=false + -Doptimization=3 correspond to -Dbuildtype=release
# Don't use warning_level and werror. They are applied also to subprojects.
# meson setup --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true
- meson setup --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=fatal $GLIB_MESON_OPTIONS
- meson compile
- 'meson test --suite glibmm:'
- meson install --quiet
artifacts:
when: always
paths:
- _build/docs/reference
release_clang_build:
extends: .build_default
stage: build
variables:
DEPENDENCIES: $MESON_DEPS clang
script:
- mkdir _build && cd _build
# -Ddebug=false + -Doptimization=3 correspond to -Dbuildtype=release
# Accept warnings. See https://gitlab.gnome.org/GNOME/glibmm/-/issues/98
# Don't use warning_level and werror. They are applied also to subprojects.
# CC=clang CXX=clang++ meson setup --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=max -Dwarning_level=3
- CC=clang CXX=clang++ meson setup --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=max $GLIB_MESON_OPTIONS
- meson compile
- 'meson test --suite glibmm:'
- meson install --quiet
allow_failure: true
artifacts:
when: on_failure
paths:
- _build/meson-logs/testlog.txt
- _build/meson-logs/meson-log.txt
expire_in: 1 week
# Publish reference documentation at gnome.pages.gitlab.gnome.org/glibmm
pages:
stage: deploy
needs: [release_gcc_build]
script:
- mkdir public
- mv _build/docs/reference/html/* public
- mv _build/docs/reference/*.tag public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
build_release_tarball:
extends: .build_default
stage: build
needs: []
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
- when: manual # and when manually triggered.
allow_failure: true # Don't block the CI pipeline until triggered.
variables:
DEPENDENCIES: $MESON_DEPS wget
script:
# Get libsigc++'s Doxygen tag file. It's published with the reference documentation.
- DOXYTAG_PATH=$(pkg-config --variable=doxytagfile sigc++-3.0)
- DOXYTAG_FILE=$(basename $DOXYTAG_PATH)
- DOXYTAG_DIR=$(dirname $DOXYTAG_PATH)
- mkdir --parents $DOXYTAG_DIR
- wget --timeout=120 --tries=2 --no-clobber --directory-prefix=$DOXYTAG_DIR $(pkg-config --variable=htmlrefpub sigc++-3.0)/$DOXYTAG_FILE || true
- mkdir _build && cd _build
# Don't use warning_level and werror. They are applied also to subprojects.
- meson setup --buildtype=release $GLIB_MESON_OPTIONS
# Must compile before 'meson dist' to generate source code and documentation.
- meson compile
- 'meson test --suite glibmm:'
# 'meson dist' without --no-tests run GLib tests, if GLib is a subproject.
- meson dist --no-tests
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/meson-dist/*.tar.xz"