Merge branch 'collectd-5.8'
[collectd.git] / .cirrus.yml
1 env:
2   LANG: C
3   DEFAULT_CONFIG_OPTS: --enable-debug --without-libstatgrab --disable-dependency-tracking
4
5
6 ###
7 # make distcheck and other sanity checks
8 #
9 release_ready_task:
10   container:
11     image: collectd/ci:stretch_amd64
12   lint_script:
13     - /checks/check-bashisms.sh
14     - /checks/check-pod.sh
15   configure_script:
16     - ./build.sh
17     - ./configure $DEFAULT_CONFIG_OPTS
18   checks_script:
19     - make -s distcheck DISTCHECK_CONFIGURE_FLAGS="${DEFAULT_CONFIG_OPTS}"
20
21 ###
22 # Default toolchain and build flags used in deb packages, on a range of Debian
23 # and Ubuntu releases (+ Debian/unstable)
24 # Most should succeed, and PRs shouldn't break them.
25 #
26 debian_default_toolchain_task:
27   matrix:
28     - allow_failures: true
29       skip_notifications: true
30       container:
31         image: collectd/ci:wheezy_amd64 # TODO: fix this platform
32     - allow_failures: false
33       container:
34         image: collectd/ci:jessie_amd64
35     - allow_failures: false
36       container:
37         image: collectd/ci:stretch_amd64
38     - allow_failures: false
39       container:
40         image: collectd/ci:stretch_i386
41     - allow_failures: false
42       container:
43         image: collectd/ci:trusty_amd64
44     - allow_failures: false
45       container:
46         image: collectd/ci:xenial_amd64
47     # debian/unstable is expected to fail
48     - allow_failures: true
49       skip_notifications: true
50       only_if: $CIRRUS_BRANCH == 'master'
51       container:
52         image: collectd/ci:sid_amd64
53   configure_script:
54     - ./build.sh
55     - gcc --version
56     - >
57       ./configure CC=gcc $DEFAULT_CONFIG_OPTS
58       CFLAGS="$(dpkg-buildflags --get CFLAGS)"
59       CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
60       LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
61   build_script:
62     - make -sk
63   tests_script:
64     - make -sk check
65     - /checks/check-built-plugins.sh
66
67 ###
68 # Default toolchain and build flags used in RPM packages, on a range of RedHat
69 # and Fedora releases (+ Fedora/rawhide)
70 # Most should succeed, and PRs shouldn't break them.
71 #
72 redhat_default_toolchain_task:
73   matrix:
74     - allow_failures: false
75       skip_notifications: false
76       container:
77         image: collectd/ci:el6_x86_64
78     - allow_failures: true
79       skip_notifications: true
80       container:
81         image: collectd/ci:el7_x86_64 # TODO: fix this platform
82     - allow_failures: true
83       skip_notifications: true
84       container:
85         image: collectd/ci:fedora26_x86_64
86     - allow_failures: true
87       skip_notifications: true
88       container:
89         image: collectd/ci:fedora28_x86_64
90     # fedora/rawhide is expected to fail
91     - allow_failures: true
92       skip_notifications: true
93       only_if: $CIRRUS_BRANCH == 'master'
94       container:
95         image: collectd/ci:fedora_rawhide_x86_64
96   configure_script:
97     - ./build.sh
98     - gcc --version
99     - ./configure CC=gcc $DEFAULT_CONFIG_OPTS CFLAGS="$(rpm --eval '%optflags')"
100   build_script:
101     - make -sk
102   tests_script:
103     - make -sk check
104     - /checks/check-built-plugins.sh
105
106
107 ###
108 # Misc non-standard build environment & options on most recent released debian
109 # version.
110 # Some are expected to fail, others should always pass
111 non_standard_toolchains_task:
112   container:
113     image: collectd/ci:stretch_amd64
114   only_if: $CIRRUS_PR == ''
115
116   matrix:
117
118     # build using clang with default build flags, should always pass
119     - env:
120         LABEL: clang
121       allow_failures: true # TODO: fix this platform
122       skip_notifications: true
123       configure_script:
124         - ./build.sh
125         - clang --version
126         - >
127           ./configure CC=clang
128           $DEFAULT_CONFIG_OPTS
129           CFLAGS="$(dpkg-buildflags --get CFLAGS)"
130           CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
131           LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
132       build_script:
133         - make -sk
134       tests_script:
135         - make -sk check
136
137     # build against libstatgrab, should always pass
138     - env:
139         LABEL: statgrab
140       allow_failures: false
141       skip_notifications: false
142       configure_script:
143         - ./build.sh
144         - gcc --version
145         - >
146           ./configure --with-libstatgrab --enable-debug
147           CFLAGS="$(dpkg-buildflags --get CFLAGS)"
148           CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
149           LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
150       build_script:
151         - make -sk
152       tests_script:
153         - >
154           for i in cpu disk interface load memory swap users; do
155             if ! $(ldd ".libs/${i}.so" 2>/dev/null | grep -q 'libstatgrab.so'); then
156               echo "plugin $i NOT linked against libstatgrab"
157               exit 1
158             fi
159           done
160
161     # build against musl-libc using gcc wrapper, expected to fail
162     - env:
163         LABEL: musl libc
164       allow_failures: true
165       skip_notifications: true
166       configure_script:
167         - ./build.sh
168         - musl-gcc --version
169         - >
170           ./configure CC=musl-gcc
171           $DEFAULT_CONFIG_OPTS
172           CFLAGS="$(dpkg-buildflags --get CFLAGS)"
173           CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
174           LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
175       build_script:
176         - make -sk
177       tests_script:
178         - make -sk check
179
180     # build using clang with a collection of strict build flags, will most
181     # probably always fail
182     - env:
183         LABEL: clang strict
184       allow_failures: true
185       skip_notifications: true
186       configure_script:
187         - ./build.sh
188         - clang --version
189         - >
190           ./configure CC=clang
191           $DEFAULT_CONFIG_OPTS
192           CFLAGS='-Wall
193           -Wno-error
194           -Wextra
195           -Wformat=2
196           -Wformat-security
197           -Wformat-nonliteral
198           -Wmissing-include-dirs
199           -Wold-style-definition
200           -Wpointer-arith
201           -Winit-self
202           -Wmissing-prototypes
203           -Wimplicit-function-declaration
204           -Wmissing-declarations
205           -Wstrict-prototypes
206           -Wmissing-noreturn
207           -Wshadow
208           -Wendif-labels
209           -Wwrite-strings
210           -Wno-unused-parameter
211           -Wno-missing-field-initializers
212           -Wdate-time
213           -Wnested-externs
214           -Wno-typedef-redefinition
215           -Wno-gnu-variable-sized-type-not-at-end'
216       build_script:
217         - make -sk
218       tests_script:
219         - make -sk check
220
221 ###
222 # Build using a range of compilers, available in debian/unstable. NB: might
223 # fail because of changes to the distro, not the compiler used.
224 #
225 bleeding_edge_compilers_task:
226   container:
227     image: collectd/ci:sid_amd64
228   only_if: $CIRRUS_BRANCH == 'master'
229   allow_failures: true
230   skip_notifications: true
231   env:
232     matrix:
233       CC: gcc-7
234       CC: gcc-8
235       CC: clang-6.0
236       CC: clang-7
237       CC: clang-8
238       CC: clang-9
239   configure_script:
240     - ./build.sh
241     - $CC --version
242     - >
243       ./configure CC=$CC
244       $DEFAULT_CONFIG_OPTS
245       CFLAGS="$(dpkg-buildflags --get CFLAGS)"
246       CPPLAGS="$(dpkg-buildflags --get CPPFLAGS)"
247       LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
248   build_script:
249     - make -sk
250   tests_script:
251     - make -sk check