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