Add mingw64 cross build CI
[glib.git] / .gitlab-ci.yml
blobcfabdcd62d07bbc6b781c4ab380ec2ea24ec717e
1 image: registry.gitlab.gnome.org/gnome/glib/master:v3
3 stages:
4   - build
5   - coverage
6   - deploy
8 cache:
9   paths:
10     - _ccache/
12 variables:
13   MESON_TEST_TIMEOUT_MULTIPLIER: 2
15 fedora-meson-x86_64:
16   stage: build
17   variables:
18    CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
19   script:
20     - meson --prefix /usr --libdir /usr/lib64 --buildtype debug --werror -Dsystemtap=true -Ddtrace=true _build .
21     - cd _build
22     - ninja
23     - meson test --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER}
24     - cd ..
25     - mkdir -p _coverage
26     - lcov --rc lcov_branch_coverage=1 --directory . --capture --no-external --output-file "_coverage/${CI_JOB_NAME}.lcov"
27   except:
28     - tags
29   artifacts:
30     name: "glib-_${CI_COMMIT_REF_NAME}"
31     paths:
32       - "${CI_PROJECT_DIR}/_build/meson-logs"
33       - "${CI_PROJECT_DIR}/_coverage"
35 fedora-meson-android_ndk_r16_api21_arm64:
36   stage: build
37   except:
38     - tags
39   script:
40     # FIXME: add --werror
41     - meson --cross-file=/opt/cross-file-android_ndk_r16_api21_arm64.txt -Diconv=gnu -Dinternal_pcre=true --buildtype debug _build
42     - ninja -C _build
43   artifacts:
44     paths:
45       - "${CI_PROJECT_DIR}/_build/meson-logs"
47 fedora-meson-mingw64:
48   stage: build
49   except:
50     - tags
51   script:
52     # FIXME: Add --werror
53     - meson --cross-file=/opt/cross_file_mingw64.txt --buildtype debug _build
54     - ninja -C _build
55   artifacts:
56     paths:
57       - "${CI_PROJECT_DIR}/_build/meson-logs"
59 msys2-mingw32:
60   stage: build
61   tags:
62     - win32
63   variables:
64     MSYSTEM: "MINGW32"
65     CHERE_INVOKING: "yes"
66   script:
67     - C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
68     - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
69   artifacts:
70     paths:
71       - _coverage/
73 vs2017-x64:
74   stage: build
75   tags:
76     - win32
77   script:
78     - .gitlab-ci/test-msvc.bat
79   artifacts:
80     when: always
81     paths:
82       - _build/meson-logs
84 coverage:
85   stage: coverage
86   artifacts:
87     paths:
88       - _coverage/
89   script:
90     - bash -x ./.gitlab-ci/coverage-docker.sh
91   coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
93 pages:
94   stage: deploy
95   script:
96     - mv _coverage/ public/
97   artifacts:
98     paths:
99       - public
100   only:
101     - master
103 dist-job:
104   stage: build
105   only:
106     - tags
107   script:
108     - meson --prefix /usr --libdir /usr/lib64 --buildtype release -Dgtk_doc=true -Dman=true _build .
109     - cd _build
110     - ninja dist
111     - ninja glib-doc
112     - tar -c -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
113     - tar -c -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
114     - tar -c -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
115   artifacts:
116     paths:
117       - "${CI_PROJECT_DIR}/_build/glib-docs.tar.xz"
118       - "${CI_PROJECT_DIR}/_build/gobject-docs.tar.xz"
119       - "${CI_PROJECT_DIR}/_build/gio-docs.tar.xz"
120       - "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"