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