Merge branch 'g-clear-pointer-no-side-effects' into 'master'
[glib.git] / .gitlab-ci.yml
bloba3634df87e321f5af8a0da125ea2ba50830e7f49
1 image: registry.gitlab.gnome.org/gnome/glib/master:v6
3 stages:
4   - build
5   - coverage
6   - deploy
8 cache:
9   paths:
10     - _ccache/
12 variables:
13   MESON_TEST_TIMEOUT_MULTIPLIER: 2
14   G_MESSAGES_DEBUG: all
16 fedora-x86_64:
17   stage: build
18   except:
19     - tags
20   variables:
21     CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
22   script:
23     - meson --buildtype debug --werror -Dsystemtap=true -Ddtrace=true -Dfam=true _build .
24     - ninja -C _build
25     - mkdir -p _coverage
26     - lcov --rc lcov_branch_coverage=1 --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
27     - meson test -C _build --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER}
28     - lcov --rc lcov_branch_coverage=1 --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
29   artifacts:
30     name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
31     when: always
32     paths:
33       - "_build/meson-logs"
34       - "_coverage"
36 .cross-template: &cross-template
37   stage: build
38   except:
39     - tags
40   artifacts:
41     name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
42     when: always
43     paths:
44       - "_build/meson-logs"
46 cross-android_api21_arm64:
47   <<: *cross-template
48   script:
49     # FIXME: add --werror
50     - meson --cross-file=/opt/cross_file_android_arm64_21.txt -Diconv=gnu -Dinternal_pcre=true --buildtype debug _build
51     - ninja -C _build
53 cross-android_api28_arm64:
54   <<: *cross-template
55   script:
56     # FIXME: add --werror
57     - meson --cross-file=/opt/cross_file_android_arm64_28.txt -Dinternal_pcre=true --buildtype debug _build
58     - ninja -C _build
60 cross-mingw64:
61   <<: *cross-template
62   script:
63     # FIXME: Add --werror
64     - meson --cross-file=/opt/cross_file_mingw64.txt --buildtype debug _build
65     - ninja -C _build
67 msys2-mingw32:
68   stage: build
69   except:
70     - tags
71   tags:
72     - win32
73   variables:
74     MSYSTEM: "MINGW32"
75     CHERE_INVOKING: "yes"
76   script:
77     - C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
78     - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
79   artifacts:
80     name: "glib-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%"
81     when: always
82     paths:
83       - _build/meson-logs
84       - _coverage/
86 vs2017-x64:
87   stage: build
88   except:
89     - tags
90   tags:
91     - win32
92   script:
93     - .gitlab-ci/test-msvc.bat
94   artifacts:
95     name: "glib-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%"
96     when: always
97     paths:
98       - _build/meson-logs
100 freebsd-11-x86_64:
101   when: manual
102   stage: build
103   tags:
104     # To run a FreeBSD builder, install gitlab-runner package and start both
105     # gitlab-runner and dbus service because we need /var/lib/dbus/machine-id.
106     # To compile GLib, you still have to install the following packages:
107     # desktop-file-utils gettext libiconv meson pkgconf python3 shared-mime-info
108     - freebsd-11
109   variables:
110     # CPPFLAGS is required because libintl doesn't use pkg-config.
111     CPPFLAGS: -I/usr/local/include
112     # FIXME: Workaround meson inability to set LD_LIBRARY_PATH.
113     # https://github.com/mesonbuild/meson/issues/1383
114     # https://github.com/mesonbuild/meson/issues/1635
115     # https://github.com/mesonbuild/meson/issues/2881
116     LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
117     # FreeBSD doesn't have C.UTF-8 locale.
118     LANG: en_US.UTF-8
119   script:
120     # We cannot use -Wl,--no-undefined because GLib uses 'environ' variable.
121     # FreeBSD iconv doesn't handle transliteration, so we use GNU libiconv here.
122     # FreeBSD supports xattr, but its API is different from Linux xattr.
123     # FIXME: extattr(2) support: https://gitlab.gnome.org/GNOME/glib/issues/1404
124     - meson -Db_lundef=false -Diconv=gnu -Dxattr=false --buildtype debug _build
125     - ninja -C _build
126     - meson test -C _build --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}"
127   # FIXME: Remove this when we have a stable FreeBSD runner
128   # https://gitlab.gnome.org/Infrastructure/GitLab/issues/286
129   allow_failure: true
130   except:
131     - tags
132   artifacts:
133     name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
134     when: always
135     paths:
136       - "_build/meson-logs"
138 coverage:
139   stage: coverage
140   artifacts:
141     name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
142     paths:
143       - _coverage/
144   script:
145     - bash -x ./.gitlab-ci/coverage-docker.sh
146   coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
148 pages:
149   stage: deploy
150   only:
151     - master
152   script:
153     - mv _coverage/ public/
154   artifacts:
155     paths:
156       - public
158 dist-job:
159   stage: build
160   only:
161     - tags
162   script:
163     - meson --buildtype release -Dgtk_doc=true -Dman=true _build
164     - cd _build
165     - ninja dist
166     - ninja glib-doc gobject-doc gio-doc
167     - tar -c -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
168     - tar -c -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
169     - tar -c -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
170   artifacts:
171     paths:
172       - "${CI_PROJECT_DIR}/_build/glib-docs.tar.xz"
173       - "${CI_PROJECT_DIR}/_build/gobject-docs.tar.xz"
174       - "${CI_PROJECT_DIR}/_build/gio-docs.tar.xz"
175       - "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"