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