Merge pull request #2779 from noahajac/master
[networkupstools.git] / .travis.yml
blob900fff634402d52e2eac89d2f930c23a2995e778
1 # Travis CI script
2 ################################################################################
3 # This file is based on a template used by zproject, but isn't auto-generated. #
4 ################################################################################
6 language:
7 - c
9 cache:
10 - ccache
12 os:
13 - linux
15 sudo: false
17 # Tests for cppunit require C++11 which requires gcc-4.8 or newer.
18 # This is available in either "trusty" or newer distros (e.g. "xenial"
19 # which we also reference explicitly for additional repositories below),
20 # or in "docker" envs.
21 dist: xenial
23 services:
24 - docker
26 # Common required packages for all common scenarios
27 # Note that YAML lists may be named with & and referenced with * characters;
28 # but without such links, every list is complete and unique (meaning that
29 # matrix special cases define their own settings, not append to common ones).
30 # See https://github.com/travis-ci/travis-ci/issues/3505
31 addons:
32   apt:
33     packages: &deps_driverlibs
34     - git
35     - ccache
36     - libcppunit-dev
37     - libcppunit-subunit-dev
38     - libneon27
39     - libneon27-dev
40     - libltdl7
41     - libltdl-dev
42     - libi2c-dev
43     - lua5.1
44     - liblua5.1-0-dev
45     - libsnmp-dev
46     - libfreeipmi-dev
47     - libipmimonitoring-dev
48     - libusb-dev
49     - linux-libc-dev
50     - libpowerman0-dev
51     - libavahi-common-dev
52     - libavahi-core-dev
53     - libavahi-client-dev
54     - libgd2-xpm-dev
55     - libpng-dev
56     - libjpeg-dev
57     - libfreetype6-dev
58     - libxpm-dev
59     - libxml2-utils
60     - libmodbus-dev
61     - libnss3-dev
62     - libssl-dev
63 # NOTE: Keep the list above in sync with replicas like deps_driverlibs_cross_i386 below
65 # Common settings for jobs in the matrix built below
66 env:
67   global:
68     - CI_TIME=true
69     - CI_TRACE=false
70     - CI_DEFAULT_HOMEBREW_NO_AUTO_UPDATE=1
71       # By default, avoid updating (including cleaning) osx worker beside what
72       # we require to install, compared to what Travis provides. Technically
73       # we can call master branch builds sometimes to update the workers cache
74       # of packages by manual or timer-driven runs with explicit setting like
75       # HOMEBREW_NO_AUTO_UPDATE=0
77 # Builds with customized setups
78 # Note that doc-related builds take the longest, and Travis CI cloud
79 # runs only a few sub-jobs in parallel, so we want the withdoc and
80 # perhaps spellcheck jobs to start first, and while they are still in
81 # progress, others are spawned and finished - reducing overall job TTL.
82 # Note that the nut-driver-enumerator tests should be tried in at least
83 # the shell interpreters reasonable for default setups of Solaris/illumos
84 # (ksh) and Linux (bash, dash, etc.) common distros.
86 # First pass is a few default compilations that normally happen
87 # early in Travis CI build chain
88 _matrix_required_linux_pass1_quick:
89   include: &_matrix_required_linux_pass1_quick
90   - env: BUILD_TYPE=default-nodoc
91     os: linux
92     addons:
93       apt:
94         packages:
95         - *deps_driverlibs
97   - env: BUILD_TYPE=default-spellcheck
98     os: linux
99     addons:
100       apt:
101         packages: &deps_aspell
102         - aspell
103         - aspell-en
105   - env: BUILD_TYPE=default
106     os: linux
107     addons:
108       apt:
109         packages:
110         - *deps_driverlibs
112   - env: BUILD_TYPE=default-tgt:distcheck-light
113     os: linux
114     addons:
115       apt:
116         packages:
117         - *deps_driverlibs
119 # Second pass is a number of shell script syntax checks in standard env:
120 _matrix_required_linux_pass2_shell:
121   include: &_matrix_required_linux_pass2_shell
122   - env: BUILD_TYPE=default-shellcheck
123     os: linux
124     addons:
125       apt:
126         packages:
127         - coreutils
128         - file
129         #TBD# - shellcheck
131   - env: BUILD_TYPE=nut-driver-enumerator-test SHELL_PROGS=bash
132     os: linux
133     services:
134         - docker
135     addons:
136       apt:
137         packages:
138         - bash
139   - env: BUILD_TYPE=nut-driver-enumerator-test SHELL_PROGS=ksh
140     os: linux
141     services:
142         - docker
143     addons:
144       apt:
145         packages:
146         - ksh
147   - env: BUILD_TYPE=nut-driver-enumerator-test SHELL_PROGS=dash
148     os: linux
149     services:
150         - docker
151     addons:
152       apt:
153         packages:
154         - dash
155   - env: BUILD_TYPE=nut-driver-enumerator-test SHELL_PROGS=ash
156     os: linux
157     services:
158         - docker
159     addons:
160       apt:
161         packages:
162         - ash
164 # Third pass is a number of larger builds that confirm non-core code is clean:
165 _matrix_required_linux_pass3_large:
166   include: &_matrix_required_linux_pass3_large
167   - env: BUILD_TYPE=default-tgt:distcheck-valgrind
168     os: linux
169     sudo: false
170     services:
171         - docker
172     addons:
173       apt:
174         packages:
175         - *deps_driverlibs
176         - valgrind
178   - env: BUILD_TYPE=default-withdoc
179     os: linux
180     addons:
181       apt:
182         packages: &deps_gendocs
183         - asciidoc
184         - xsltproc
185         - dblatex
186         - docbook-xsl
187         - docbook-xsl-ns
188         - source-highlight
189         - libxml2-utils
191   - env: BUILD_TYPE=default-alldrv
192     os: linux
193     sudo: false
194     services:
195         - docker
196     addons:
197       apt:
198         packages:
199         - *deps_driverlibs
201   - env:
202     - BUILD_TYPE=default-tgt:distcheck-light
203     - NO_PKG_CONFIG=true
204     os: linux
205     sudo: true
206     addons:
207       apt:
208         packages:
209         - *deps_driverlibs
211 # Re-run the build of all binaries we can make, with
212 # varied compiler and C/C++ standard implementations
213 # and different lenience against warnings. Many of
214 # these blocks look similar and all should have unique
215 # "env" field to use some with allowed_failure below.
216 # For a list of standards supported, see:
217 #   https://gcc.gnu.org/onlinedocs/gcc/Standards.html
218 #   https://gcc.gnu.org/projects/cxx-status.html
219 #   https://clang.llvm.org/cxx_status.html
220 # Note that while there is C++14 there is no C14:
221 #   https://en.wikipedia.org/wiki/C_(programming_language)#History
223 # The leading NUT_MATRIX_TAG allows humans to understand
224 # what a test case is about in Travis CI dashboard table
225 # of jobs, but otherwise it is not used by script code.
227 # Note that passing multi-token C*FLAGS may be problematic
228 # for sub-makes like distcheck; verify thoroughly before
229 # trying to enable those if that would make sense anytime.
231 # Ordered by variants expected to succeed to run first,
232 # although with current Travis CI implementation, the env
233 # blocks listed in allowed_failures only run after all
234 # those not listed. Jobs which currently fail until code
235 # gets fixed are conditional with "if: branch =~ fightwarn"
236 # so users (and NUT upstream) can define a branch with a
237 # name containing this keyword to work on bug fixes, but by
238 # default the main development would not bother Travis CI
239 # to waste resources in vain.
242 _matrix_linux_gnustd_nowarn:
243   include: &_matrix_linux_gnustd_nowarn
244   - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
245     os: linux
246     sudo: false
247     services:
248         - docker
249     compiler: gcc
250     addons:
251       apt:
252         packages:
253         - *deps_driverlibs
255   - env: NUT_MATRIX_TAG="gnu99-gcc-7-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc-7 CXX=g++-7
256     os: linux
257     sudo: false
258     services:
259         - docker
260     compiler: gcc
261     addons:
262       apt:
263         sources:
264         - ubuntu-toolchain-r-test
265         packages:
266         - g++-7
267         - gcc-7
268         - *deps_driverlibs
270   - env: NUT_MATRIX_TAG="gnu11-gcc-7-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu11" CXXFLAGS="-std=gnu++11" CC=gcc-7 CXX=g++-7
271     os: linux
272     sudo: false
273     services:
274         - docker
275     compiler: gcc
276     addons:
277       apt:
278         sources:
279         - ubuntu-toolchain-r-test
280         packages:
281         - g++-7
282         - gcc-7
283         - *deps_driverlibs
285   - env: NUT_MATRIX_TAG="gnu17-gcc-9-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
286     os: linux
287     sudo: false
288     services:
289         - docker
290     compiler: gcc
291     addons:
292       apt:
293         sources:
294         - ubuntu-toolchain-r-test
295         packages:
296         - g++-9
297         - gcc-9
298         - *deps_driverlibs
300   - env: NUT_MATRIX_TAG="gnu99-clang-5.0-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang-5.0 CXX=clang++-5.0
301     os: linux
302     dist: xenial
303     sudo: false
304     services:
305         - docker
306     compiler: clang
307     addons:
308       apt:
309         sources:
310         - llvm-toolchain-xenial-5.0
311         packages:
312         - clang-5.0
313         - clang-format-5.0
314         - *deps_driverlibs
316   - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
317     os: linux
318     dist: xenial
319     sudo: false
320     services:
321         - docker
322     compiler: clang
323     addons:
324       apt:
325         sources:
326         - llvm-toolchain-xenial-8
327         packages:
328         - clang-8
329         - clang-format-8
330         - *deps_driverlibs
332 # Note: some of the warnings that are hidden in this case seem to be serious
333 # issues that may impact viability of binaries built by C89 mode compilers!
334   - env: NUT_MATRIX_TAG="gnu89-gcc-default-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu89" CXXFLAGS="-std=gnu++89"
335     os: linux
336     sudo: false
337     services:
338         - docker
339     compiler: gcc
340     addons:
341       apt:
342         packages:
343         - *deps_driverlibs
345 # Make sure we don't assume "long int" is a "int64_t" and so on
346 # Seems we'd have to use tricks like 32-bit docker in 64-bit VM per
347 #   https://stackoverflow.com/questions/29361465/request-for-32bit-travis-build-machine
348 #   https://github.com/travis-ci/travis-ci/issues/5770#issuecomment-197771661
349 #     services: docker
350 #     script: "docker run -i -v \"${PWD}:/MyProgram\" toopher/centos-i386:centos6 /bin/bash -c \"linux32 --32bit i386 /MyProgram/build.sh\""
351 _matrix_linux_gnustd_nowarn_x86_32bit:
352   include: &_matrix_linux_gnustd_nowarn_x86_32bit
353   - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn-x86-32bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99 -m32" CXXFLAGS="-std=gnu++99 -m32" CPPFLAGS="-m32" LDFLAGS="-m32"
354     os: linux
355     arch: i386
356     sudo: true
357         # Perl is packaged poorly for multiarch, across several distro releases:
358         # https://bugs.launchpad.net/ubuntu/+source/pkgbinarymangler/+bug/1574351
359         # NOTE: According to https://docs.travis-ci.com/user/job-lifecycle/ the
360         # before_install phase happens AFTER addons/apt processing! So we install
361         # that big list first (except pkg's that pull perl) and add them later.
362 #    before_install:
363 #        - sudo dpkg --add-architecture i386 && sudo apt-get update ; yes | sudo apt-get install -y --force-yes libperl5.22:i386 || true ; sudo rm -f /usr/share/doc/libperl5.22/changelog.Debian.gz ; yes | sudo apt-get install -y --force-yes libperl5.22
364     services:
365         - docker
366     compiler: gcc
367     addons:
368       apt:
369         packages: &deps_driverlibs_cross_i386
370         - git
371         - ccache
372         - gcc-multilib
373         - g++-multilib
374         - libcppunit-dev:i386
375         - libcppunit-subunit-dev:i386
376         - libneon27:i386
377         - libneon27-dev:i386
378         - libltdl7:i386
379         - libltdl-dev:i386
380         #MISSING:i386? hdr only?# - libi2c-dev:i386
381         - libi2c-dev
382         - lua5.1:i386
383         - liblua5.1-0-dev:i386
384         #PULLSPERL# - libsnmp-dev:i386
385         - libfreeipmi-dev:i386
386         - libipmimonitoring-dev:i386
387         - libusb-dev:i386
388         - linux-libc-dev:i386
389         - libpowerman0-dev:i386
390         - libavahi-common-dev:i386
391         - libavahi-core-dev:i386
392         - libavahi-client-dev:i386
393         - libgd2-xpm-dev:i386
394         - libpng-dev:i386
395         - libjpeg-dev:i386
396         - libfreetype6-dev:i386
397         - libxpm-dev:i386
398         - libxml2-utils:i386
399         - libmodbus-dev:i386
400         - libnss3-dev:i386
401         - libssl-dev:i386
402     # See comments above about perl
403     before_install: &before_install_x86_32bit
404         - sudo dpkg --add-architecture i386 && sudo apt-get update
405         - yes | sudo apt-get install -y --force-yes libperl5.22 || true
406         - sudo rm -f /usr/share/doc/libperl5.22/changelog.Debian.gz
407         - yes | sudo apt-get install -f
408         - yes | sudo apt-get install -y --force-yes libperl5.22:i386
409         - yes | sudo apt-get install -y --force-yes libsnmp-dev:i386
410         - yes | sudo apt-get remove -y --force-yes libfreetype6:amd64 || true
411         - yes | sudo apt-get remove -y --force-yes libltdl7:amd64 || true
413   - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn-x86-32bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17 -m32" CXXFLAGS="-std=gnu++17 -m32" CPPFLAGS="-m32" LDFLAGS="-m32" CC=clang-8 CXX=clang++-8
414     os: linux
415     arch: x86
416     dist: xenial
417     sudo: true
418     before_install:
419         - *before_install_x86_32bit
420 #        - sudo dpkg --add-architecture i386 && sudo apt-get update
421 #        - yes | sudo apt-get install -y --force-yes libperl5.22 || true
422 #        - sudo rm -f /usr/share/doc/libperl5.22/changelog.Debian.gz
423 #        - sudo apt-get install -f
424 #        - yes | apt-get install -y --force-yes libperl5.22:i386
425     services:
426         - docker
427     compiler: clang
428     addons:
429       apt:
430         sources:
431         - llvm-toolchain-xenial-8
432         packages:
433         - clang-8
434         - clang-format-8
435         - *deps_driverlibs_cross_i386
437 # Try s390x builds to check for issues with endianness
438 # (it is one current Travis offer with BigEndian CPUs)
439 _matrix_linux_gnustd_nowarn_s390x_64bit_viable:
440   include: &_matrix_linux_gnustd_nowarn_s390x_64bit_viable
441   - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn-s390x-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
442     os: linux
443     arch: s390x
444     sudo: false
445     services:
446         - docker
447     compiler: gcc
448     addons:
449       apt:
450         packages:
451         - *deps_driverlibs
452         - time
454   - env: NUT_MATRIX_TAG="gnu17-gcc-9-nowarn-s390x-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
455     os: linux
456     arch: s390x
457     sudo: false
458     services:
459         - docker
460     compiler: gcc
461     addons:
462       apt:
463         sources:
464         - ubuntu-toolchain-r-test
465         packages:
466         - g++-9
467         - gcc-9
468         - *deps_driverlibs
469         - time
471   - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn-s390x-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
472     os: linux
473     arch: s390x
474     dist: xenial
475     sudo: false
476     services:
477         - docker
478     compiler: clang
479     if: branch =~ fightwarn
480     addons:
481       apt:
482         sources:
483         - llvm-toolchain-xenial-8
484         packages:
485         - clang-8
486         - clang-format-8
487         - *deps_driverlibs
488         - time
490 _matrix_linux_gnustd_nowarn_s390x_64bit_fatal:
491   include: &_matrix_linux_gnustd_nowarn_s390x_64bit_fatal
492   - env: NUT_MATRIX_TAG="gnu17-clang-8-warn-s390x-64bit" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
493     os: linux
494     arch: s390x
495     dist: xenial
496     sudo: false
497     services:
498         - docker
499     compiler: clang
500     if: branch =~ fightwarn
501     addons:
502       apt:
503         sources:
504         - llvm-toolchain-xenial-8
505         packages:
506         - clang-8
507         - clang-format-8
508         - *deps_driverlibs
509         - time
511 # Try ARM builds to check for issues with non-x86 CPUs
512 _matrix_linux_gnustd_nowarn_arm_64bit_viable:
513   include: &_matrix_linux_gnustd_nowarn_arm_64bit_viable
514   - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn-ARM-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
515     os: linux
516     arch: arm64
517     sudo: false
518     services:
519         - docker
520     compiler: gcc
521     addons:
522       apt:
523         packages:
524         - *deps_driverlibs
526   - env: NUT_MATRIX_TAG="gnu17-gcc-9-nowarn-ARM-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
527     os: linux
528     arch: arm64
529     sudo: false
530     services:
531         - docker
532     compiler: gcc
533     addons:
534       apt:
535         sources:
536         - ubuntu-toolchain-r-test
537         packages:
538         - g++-9
539         - gcc-9
540         - *deps_driverlibs
542 _matrix_linux_gnustd_nowarn_arm_64bit_fatal:
543   include: &_matrix_linux_gnustd_nowarn_arm_64bit_fatal
544   - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn-ARM-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
545     os: linux
546     arch: arm64
547     dist: xenial
548     sudo: false
549     services:
550         - docker
551     compiler: clang
552     if: branch =~ fightwarn
553     addons:
554       apt:
555         sources:
556         - llvm-toolchain-xenial-8
557         packages:
558         - clang-8
559         - clang-format-8
560         - *deps_driverlibs
562 # At this time, anything with strict C standard fails on Linux, even "nowarn" cases:
563 _matrix_linux_cstd_nowarn:
564   include: &_matrix_linux_cstd_nowarn
565   - env: NUT_MATRIX_TAG="c99-clang-3.5-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang-3.5 CXX=clang++-3.5
566     os: linux
567     dist: xenial
568     sudo: false
569     services:
570         - docker
571     compiler: clang
572     if: branch =~ fightwarn
573     addons:
574       apt:
575         sources:
576         - llvm-toolchain-xenial-3.5
577         packages:
578         - clang-3.5
579         - clang-format-3.5
580         - *deps_driverlibs
582   - env: NUT_MATRIX_TAG="c99-clang-5.0-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang-5.0 CXX=clang++-5.0
583     os: linux
584     dist: xenial
585     sudo: false
586     services:
587         - docker
588     compiler: clang
589     if: branch =~ fightwarn
590     addons:
591       apt:
592         sources:
593         - llvm-toolchain-xenial-5.0
594         packages:
595         - clang-5.0
596         - clang-format-5.0
597         - *deps_driverlibs
599   - env: NUT_MATRIX_TAG="c11-clang-5.0-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c11" CXXFLAGS="-std=c++11" CC=clang-5.0 CXX=clang++-5.0
600     os: linux
601     dist: xenial
602     sudo: false
603     services:
604         - docker
605     compiler: clang
606     if: branch =~ fightwarn
607     addons:
608       apt:
609         sources:
610         - llvm-toolchain-xenial-5.0
611         packages:
612         - clang-5.0
613         - clang-format-5.0
614         - *deps_driverlibs
616   - env: NUT_MATRIX_TAG="c17-clang-8-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang-8 CXX=clang++-8
617     os: linux
618     dist: xenial
619     sudo: false
620     services:
621         - docker
622     compiler: clang
623     if: branch =~ fightwarn
624     addons:
625       apt:
626         sources:
627         - llvm-toolchain-xenial-8
628         packages:
629         - clang-8
630         - clang-format-8
631         - *deps_driverlibs
633 # Stuff with warnings made fatal... and codebase got good enough to survive!
634 _matrix_linux_gnustd_warn_viable:
635   include: &_matrix_linux_gnustd_warn_viable
636   - env: NUT_MATRIX_TAG="cDefault-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard
637     os: linux
638     sudo: false
639     services:
640         - docker
641     compiler: gcc
642     if: branch =~ fightwarn
643     addons:
644       apt:
645         packages:
646         - *deps_driverlibs
648   - env: NUT_MATRIX_TAG="gnu99-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
649     os: linux
650     sudo: false
651     services:
652         - docker
653     compiler: gcc
654     if: branch =~ fightwarn
655     addons:
656       apt:
657         packages:
658         - *deps_driverlibs
660   - env: NUT_MATRIX_TAG="gnu11-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu11" CXXFLAGS="-std=gnu++11"
661     os: linux
662     sudo: false
663     services:
664         - docker
665     compiler: gcc
666     if: branch =~ fightwarn
667     addons:
668       apt:
669         packages:
670         - *deps_driverlibs
672   - env: NUT_MATRIX_TAG="gnu99-gcc-7-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc-7 CXX=g++-7
673     os: linux
674     sudo: false
675     services:
676         - docker
677     compiler: gcc
678     if: branch =~ fightwarn
679     addons:
680       apt:
681         sources:
682         - ubuntu-toolchain-r-test
683         packages:
684         - g++-7
685         - gcc-7
686         - *deps_driverlibs
688   - env: NUT_MATRIX_TAG="gnu17-gcc-9-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
689     os: linux
690     sudo: false
691     services:
692         - docker
693     compiler: gcc
694     if: branch =~ fightwarn
695     addons:
696       apt:
697         sources:
698         - ubuntu-toolchain-r-test
699         packages:
700         - g++-9
701         - gcc-9
702         - *deps_driverlibs
704 # Stuff with warnings made fatal... well, is usually fatal so far:
705 _matrix_linux_gnustd_warn_fatal:
706   include: &_matrix_linux_gnustd_warn_fatal
707 # Note: Fixing these would make NUT viable again on platforms with only ANSI C!
708   - env: NUT_MATRIX_TAG="gnu89-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu89" CXXFLAGS="-std=gnu++89"
709     os: linux
710     sudo: false
711     services:
712         - docker
713     compiler: gcc
714     if: branch =~ fightwarn
715     addons:
716       apt:
717         packages:
718         - *deps_driverlibs
720 # The hardest of two worlds: both strict C standards on Linux and fatal warnings:
721 _matrix_linux_cstd_warn:
722   include: &_matrix_linux_cstd_warn
723   - env: NUT_MATRIX_TAG="c99-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++98"
724     os: linux
725     sudo: false
726     services:
727         - docker
728     compiler: gcc
729     if: branch =~ fightwarn
730     addons:
731       apt:
732         packages:
733         - *deps_driverlibs
735   - env: NUT_MATRIX_TAG="c99-clang-5.0-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang-5.0 CXX=clang++-5.0
736     os: linux
737     dist: xenial
738     sudo: false
739     services:
740         - docker
741     compiler: clang
742     if: branch =~ fightwarn
743     addons:
744       apt:
745         sources:
746         - llvm-toolchain-xenial-5.0
747         packages:
748         - clang-5.0
749         - clang-format-5.0
750         - *deps_driverlibs
752   - env: NUT_MATRIX_TAG="c11-clang-5.0-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c11" CXXFLAGS="-std=c++11" CC=clang-5.0 CXX=clang++-5.0
753     os: linux
754     dist: xenial
755     sudo: false
756     services:
757         - docker
758     compiler: clang
759     if: branch =~ fightwarn
760     addons:
761       apt:
762         sources:
763         - llvm-toolchain-xenial-5.0
764         packages:
765         - clang-5.0
766         - clang-format-5.0
767         - *deps_driverlibs
769   - env: NUT_MATRIX_TAG="c17-clang-8-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang-8 CXX=clang++-8
770     os: linux
771     dist: xenial
772     sudo: false
773     services:
774         - docker
775     compiler: clang
776     if: branch =~ fightwarn
777     addons:
778       apt:
779         sources:
780         - llvm-toolchain-xenial-8
781         packages:
782         - clang-8
783         - clang-format-8
784         - *deps_driverlibs
786   - env: NUT_MATRIX_TAG="c11-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c11" CXXFLAGS="-std=c++11"
787     os: linux
788     sudo: false
789     services:
790         - docker
791     compiler: gcc
792     if: branch =~ fightwarn
793     addons:
794       apt:
795         packages:
796         - *deps_driverlibs
798   - env: NUT_MATRIX_TAG="c89-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c89" CXXFLAGS="-std=c++89"
799     os: linux
800     sudo: false
801     services:
802         - docker
803     compiler: gcc
804     if: branch =~ fightwarn
805     addons:
806       apt:
807         packages:
808         - *deps_driverlibs
810 _matrix_freebsd_gnustd_nowarn:
811   include: &_matrix_freebsd_gnustd_nowarn
812   - env: NUT_MATRIX_TAG="gnu99-gcc-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc CXX=g++
813     os: freebsd
814     sudo: true
815     compiler: gcc
816     cache:
817       directories:
818       - $HOME/.ccache
820   - env: NUT_MATRIX_TAG="gnu99-clang-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
821     os: freebsd
822     sudo: true
823     compiler: clang
824     cache:
825       directories:
826       - $HOME/.ccache
828   - env: NUT_MATRIX_TAG="gnu17-gcc-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc CXX=g++
829     os: freebsd
830     sudo: true
831     compiler: gcc
832     cache:
833       directories:
834       - $HOME/.ccache
836   - env: NUT_MATRIX_TAG="gnu17-clang-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
837     os: freebsd
838     sudo: true
839     compiler: clang
840     cache:
841       directories:
842       - $HOME/.ccache
844 _matrix_freebsd_gnustd_warn_viable:
845   include: &_matrix_freebsd_gnustd_warn_viable
846   - env: NUT_MATRIX_TAG="gnu99-gcc-default-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc CXX=g++
847     os: freebsd
848     sudo: true
849     compiler: gcc
850     if: branch =~ fightwarn
851     cache:
852       directories:
853       - $HOME/.ccache
855   - env: NUT_MATRIX_TAG="gnu17-gcc-default-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc CXX=g++
856     os: freebsd
857     sudo: true
858     compiler: gcc
859     if: branch =~ fightwarn
860     cache:
861       directories:
862       - $HOME/.ccache
864 _matrix_freebsd_gnustd_warn_fatal:
865   include: &_matrix_freebsd_gnustd_warn_fatal
866   - env: NUT_MATRIX_TAG="gnu99-clang-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
867     os: freebsd
868     sudo: true
869     compiler: clang
870     if: branch =~ fightwarn
871     cache:
872       directories:
873       - $HOME/.ccache
875   - env: NUT_MATRIX_TAG="gnu17-clang-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
876     os: freebsd
877     sudo: true
878     compiler: clang
879     if: branch =~ fightwarn
880     cache:
881       directories:
882       - $HOME/.ccache
885 # Try also a range of platforms for MacOS X builds
886 # Inspired by https://github.com/taocpp/operators/blob/master/.travis.yml
887 _matrix_osx_gnustd_nowarn:
888   include: &_matrix_osx_gnustd_nowarn
889   - env: NUT_MATRIX_TAG="gnu99-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
890     os: osx
891     osx_image: xcode10.2
892     compiler: clang
893     cache:
894       directories:
895       - $HOME/Library/Caches/Homebrew
896       - $HOME/.ccache
898   - env: NUT_MATRIX_TAG="gnu17-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
899     os: osx
900     osx_image: xcode10.2
901     compiler: clang
902     cache:
903       directories:
904       - $HOME/Library/Caches/Homebrew
905       - $HOME/.ccache
907   - env: NUT_MATRIX_TAG="gnu99-clang-xcode7.3-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
908     os: osx
909     osx_image: xcode7.3
910     compiler: clang
911     cache:
912       directories:
913       - $HOME/Library/Caches/Homebrew
914       - $HOME/.ccache
916 _matrix_osx_gnustd_warn:
917   include: &_matrix_osx_gnustd_warn
918   - env: NUT_MATRIX_TAG="gnu99-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
919     os: osx
920     osx_image: xcode10.2
921     compiler: clang
922     if: branch =~ fightwarn
923     cache:
924       directories:
925       - $HOME/Library/Caches/Homebrew
926       - $HOME/.ccache
928   - env: NUT_MATRIX_TAG="gnu17-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
929     os: osx
930     osx_image: xcode10.2
931     compiler: clang
932     if: branch =~ fightwarn
933     cache:
934       directories:
935       - $HOME/Library/Caches/Homebrew
936       - $HOME/.ccache
938 _matrix_osx_cstd_nowarn:
939   include: &_matrix_osx_cstd_nowarn
940   - env: NUT_MATRIX_TAG="c99-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
941     os: osx
942     osx_image: xcode10.2
943     compiler: clang
944     if: branch =~ fightwarn
945     cache:
946       directories:
947       - $HOME/Library/Caches/Homebrew
948       - $HOME/.ccache
950   - env: NUT_MATRIX_TAG="c17-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang CXX=clang++
951     os: osx
952     osx_image: xcode10.2
953     compiler: clang
954     if: branch =~ fightwarn
955     cache:
956       directories:
957       - $HOME/Library/Caches/Homebrew
958       - $HOME/.ccache
960 _matrix_osx_cstd_warn:
961   include: &_matrix_osx_cstd_warn
962   - env: NUT_MATRIX_TAG="c99-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
963     os: osx
964     osx_image: xcode10.2
965     compiler: clang
966     if: branch =~ fightwarn
967     cache:
968       directories:
969       - $HOME/Library/Caches/Homebrew
970       - $HOME/.ccache
972   - env: NUT_MATRIX_TAG="c17-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang CXX=clang++
973     os: osx
974     osx_image: xcode10.2
975     compiler: clang
976     if: branch =~ fightwarn
977     cache:
978       directories:
979       - $HOME/Library/Caches/Homebrew
980       - $HOME/.ccache
982   - env: NUT_MATRIX_TAG="c11-clang-xcode7.3-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c11" CXXFLAGS="-std=c++11" CC=clang CXX=clang++
983     os: osx
984     osx_image: xcode7.3
985     compiler: clang
986     if: branch =~ fightwarn
987     cache:
988       directories:
989       - $HOME/Library/Caches/Homebrew
990       - $HOME/.ccache
992 # Try also a build on Windows to see our horizons
993 # https://docs.travis-ci.com/user/reference/windows/
994 # says we have clang-9 there by default (and there is
995 # a complex routine to add gcc if we'd need that)
996 # and a Git Bash as default shell, but no ccache.
997 # TODO: Eventually try native visualstudio compilers?
998 _matrix_windows_gnustd_nowarn:
999   include: &_matrix_windows_gnustd_nowarn
1000   - env: NUT_MATRIX_TAG="gnu99-clang-win-nowarn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
1001     os: windows
1002     compiler: clang
1003     if: branch =~ fightwarn
1004     cache:
1005       directories:
1006       - $HOME/AppData/Local/Temp/chocolatey
1007       - $HOME/.ccache
1008       - /C/tools
1010 _matrix_windows_gnustd_warn:
1011   include: &_matrix_windows_gnustd_warn
1012   - env: NUT_MATRIX_TAG="gnu99-clang-win-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1013     os: windows
1014     compiler: clang
1015     if: branch =~ fightwarn
1016     cache:
1017       directories:
1018       - $HOME/AppData/Local/Temp/chocolatey
1019       - $HOME/.ccache
1020       - /C/tools
1022 _matrix_windows_cstd_nowarn:
1023   include: &_matrix_windows_cstd_nowarn
1024   - env: NUT_MATRIX_TAG="c99-clang-win-nowarn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1025     os: windows
1026     compiler: clang
1027     if: branch =~ fightwarn
1028     cache:
1029       directories:
1030       - $HOME/AppData/Local/Temp/chocolatey
1031       - $HOME/.ccache
1032       - /C/tools
1034 _matrix_windows_cstd_warn:
1035   include: &_matrix_windows_cstd_warn
1036   - env: NUT_MATRIX_TAG="c99-clang-win-warn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1037     os: windows
1038     compiler: clang
1039     if: branch =~ fightwarn
1040     cache:
1041       directories:
1042       - $HOME/AppData/Local/Temp/chocolatey
1043       - $HOME/.ccache
1044       - /C/tools
1046 # Incidentally, this is one platform we know to have clang-9,
1047 # the version which has (at least partial) C++20 support
1048   - env: NUT_MATRIX_TAG="c20-clang-win-warn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c20" CXXFLAGS="-std=c++20" CC=clang CXX=clang++
1049     os: windows
1050     compiler: clang
1051     if: branch =~ fightwarn
1052     cache:
1053       directories:
1054       - $HOME/AppData/Local/Temp/chocolatey
1055       - $HOME/.ccache
1056       - /C/tools
1058 ###################################################################################
1059 # Summarize the matrix blocks above to quickly enable/disable subsets
1060 # of tests in development (e.g. to focus on fixing bugs and not wasting
1061 # resources on rebuilding green codebase over and over)
1063 # The original set of tests that are required for master branch CI
1064 # ...and also the set of builds with various compilers and C standards
1065 # that should survive at least without warnings made fatal...
1066 _matrix_required_linux:
1067   include: &_matrix_required_linux
1068   - *_matrix_required_linux_pass1_quick
1069   - *_matrix_required_linux_pass2_shell
1070   - *_matrix_required_linux_pass3_large
1071   - *_matrix_linux_gnustd_warn_viable
1072   - *_matrix_linux_gnustd_nowarn
1073   - *_matrix_linux_gnustd_nowarn_x86_32bit
1074   - *_matrix_linux_gnustd_nowarn_arm_64bit_viable
1075   - *_matrix_linux_gnustd_nowarn_s390x_64bit_viable
1077 _matrix_linux_gnustd_warn:
1078   include: &_matrix_linux_gnustd_warn
1079   - *_matrix_linux_gnustd_warn_viable
1080   - *_matrix_linux_gnustd_warn_fatal
1082 _matrix_allowfail_linux:
1083   include: &_matrix_allowfail_linux
1084   - *_matrix_linux_cstd_nowarn
1085   - *_matrix_linux_gnustd_warn_fatal
1086   - *_matrix_linux_cstd_warn
1087   - *_matrix_linux_gnustd_nowarn_arm_64bit_fatal
1088   - *_matrix_linux_gnustd_nowarn_s390x_64bit_fatal
1090 _matrix_linux_gnustd_nowarn_arm_64bit:
1091   include: &_matrix_linux_gnustd_nowarn_arm_64bit
1092   - *_matrix_linux_gnustd_nowarn_arm_64bit_viable
1093   - *_matrix_linux_gnustd_nowarn_arm_64bit_fatal
1095 _matrix_linux_arm:
1096   include: &_matrix_linux_arm
1097   - *_matrix_linux_gnustd_nowarn_arm_64bit
1099 _matrix_linux_gnustd_nowarn_s390x_64bit:
1100   include: &_matrix_linux_gnustd_nowarn_s390x_64bit
1101   - *_matrix_linux_gnustd_nowarn_s390x_64bit_viable
1102   - *_matrix_linux_gnustd_nowarn_s390x_64bit_fatal
1104 _matrix_linux_s390x:
1105   include: &_matrix_linux_s390x
1106   - *_matrix_linux_gnustd_nowarn_s390x_64bit
1108 _matrix_linux:
1109   include: &_matrix_linux
1110   - *_matrix_required_linux
1111   - *_matrix_allowfail_linux
1113 _matrix_freebsd:
1114   include: &_matrix_freebsd
1115   - *_matrix_freebsd_gnustd_nowarn
1116   - *_matrix_freebsd_gnustd_warn
1118 _matrix_freebsd_gnustd_warn:
1119   include: &_matrix_freebsd_gnustd_warn
1120   - *_matrix_freebsd_gnustd_warn_viable
1121   - *_matrix_freebsd_gnustd_warn_fatal
1123 _matrix_required_freebsd:
1124   include: &_matrix_required_freebsd
1125   - *_matrix_freebsd_gnustd_nowarn
1126   - *_matrix_freebsd_gnustd_warn_viable
1128 _matrix_allowfail_freebsd:
1129   include: &_matrix_allowfail_freebsd
1130   - *_matrix_freebsd_gnustd_warn_fatal
1132 _matrix_allowfail_osx:
1133   include: &_matrix_allowfail_osx
1134   - *_matrix_osx_cstd_nowarn
1135   - *_matrix_osx_gnustd_warn
1136   - *_matrix_osx_cstd_warn
1138 _matrix_required_osx:
1139   include: &_matrix_required_osx
1140   - *_matrix_osx_gnustd_nowarn
1142 _matrix_osx:
1143   include: &_matrix_osx
1144   - *_matrix_required_osx
1145   - *_matrix_allowfail_osx
1147 # Nothing this good yet
1148 #_matrix_required_windows:
1149 #  include: &_matrix_required_windows
1151 _matrix_allowfail_windows:
1152   include: &_matrix_allowfail_windows
1153   - *_matrix_windows_gnustd_nowarn
1154   - *_matrix_windows_gnustd_warn
1155   - *_matrix_windows_cstd_nowarn
1156   - *_matrix_windows_cstd_warn
1158 _matrix_windows:
1159   include: &_matrix_windows
1160 #  - *_matrix_required_windows
1161   - *_matrix_allowfail_windows
1163 # Different dissections of interest to fixers:
1164 _matrix_cstd_nowarn:
1165   include: &_matrix_cstd_nowarn
1166   - *_matrix_linux_cstd_nowarn
1167   - *_matrix_osx_cstd_nowarn
1168   - *_matrix_windows_cstd_nowarn
1170 _matrix_gnustd_nowarn:
1171   include: &_matrix_gnustd_nowarn
1172   - *_matrix_osx_gnustd_nowarn
1173   - *_matrix_linux_gnustd_nowarn
1174   - *_matrix_freebsd_gnustd_nowarn
1175 #  -*_matrix_windows_gnustd_nowarn
1176   - *_matrix_linux_gnustd_nowarn_x86_32bit
1177   - *_matrix_linux_gnustd_nowarn_arm_64bit_viable
1178   - *_matrix_linux_gnustd_nowarn_arm_64bit_fatal
1179   - *_matrix_linux_gnustd_nowarn_s390x_64bit_viable
1180   - *_matrix_linux_gnustd_nowarn_s390x_64bit_fatal
1182 _matrix_warn:
1183   include: &_matrix_warn
1184   - *_matrix_linux_gnustd_warn
1185   - *_matrix_linux_cstd_warn
1186   - *_matrix_freebsd_gnustd_warn
1187   - *_matrix_osx_gnustd_warn
1188   - *_matrix_osx_cstd_warn
1189   - *_matrix_windows_gnustd_warn
1190   - *_matrix_windows_cstd_warn
1192 # Default "jobs:" matrix should reference at least this for master branches
1193 _matrix_required:
1194   include: &_matrix_required
1195   - *_matrix_required_linux
1196   - *_matrix_required_freebsd
1197   - *_matrix_required_osx
1198 #  - *_matrix_required_windows
1200 _matrix_all:
1201   include: &_matrix_all
1202   - *_matrix_linux
1203   - *_matrix_freebsd
1204   - *_matrix_osx
1205   - *_matrix_windows
1207 _matrix_master:
1208   include: &_matrix_master
1209   - *_matrix_required
1210 ### Enabled for branches with names containing "fightwarn" to perform
1211 ### builds that intend to actively fix the issues which preclude the
1212 ### following items from becoming green:
1213   - *_matrix_allowfail_linux
1214   - *_matrix_allowfail_osx
1215   - *_matrix_allowfail_freebsd
1216   - *_matrix_windows
1218 _matrix_fixbugs:
1219   include: &_matrix_fixbugs
1220   - *_matrix_cstd_nowarn
1221   - *_matrix_warn
1223 ###################################################################################
1224 # Developers can import some of the definitions above (e.g. _matrix-fixbugs
1225 # instead of _matrix-master) to get more relevant runs of Travis CI against
1226 # their branches for their iterations trying to fix stuff.
1228 # DO NOT COMMIT TO MASTER BRANCH TEST-MATRICES THAT ARE NOT _matrix-master!
1230 # These days, "jobs" and "matrix" (Travis keywords) are same thing... at least,
1231 # ours is an explicit list.
1232 # By "fast_finish" we allow to assign a verdict based on completion of required
1233 # test cases. The "allow_failures" will proceed to run for our information
1234 # but should not block nor delay PR considerations etc.
1235 jobs:
1236   fast_finish: true
1237   include:
1238   - *_matrix_master
1240 ###################################################################################
1241 # Note: "env" lines below must exactly describe a matrix option defined above
1242   allow_failures:
1244 ### Linux on x86_64
1245 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
1246 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-7-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc-7 CXX=g++-7
1247 #OK#  - env: NUT_MATRIX_TAG="gnu11-gcc-7-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu11" CXXFLAGS="-std=gnu++11" CC=gcc-7 CXX=g++-7
1248 #OK#  - env: NUT_MATRIX_TAG="gnu17-gcc-9-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
1249 #OK#  - env: NUT_MATRIX_TAG="gnu99-clang-5.0-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang-5.0 CXX=clang++-5.0
1250 #OK#  - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
1251 #OK#  - env: NUT_MATRIX_TAG="gnu17-gcc-9-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
1252 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn-x86-32bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99 -m32" CXXFLAGS="-std=gnu++99 -m32" CPPFLAGS="-m32" LDFLAGS="-m32"
1253 #OK#  - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn-x86-32bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17 -m32" CXXFLAGS="-std=gnu++17 -m32" CPPFLAGS="-m32" LDFLAGS="-m32" CC=clang-8 CXX=clang++-8
1254   - env: NUT_MATRIX_TAG="c99-clang-3.5-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang-3.5 CXX=clang++-3.5
1255   - env: NUT_MATRIX_TAG="c99-clang-5.0-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang-5.0 CXX=clang++-5.0
1256   - env: NUT_MATRIX_TAG="c11-clang-5.0-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c11" CXXFLAGS="-std=c++11" CC=clang-5.0 CXX=clang++-5.0
1257   - env: NUT_MATRIX_TAG="c17-clang-8-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang-8 CXX=clang++-8
1258   - env: NUT_MATRIX_TAG="c17-clang-8-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang-8 CXX=clang++-8
1259 #OK#  - env: NUT_MATRIX_TAG="cDefault-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard
1260 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
1261   - env: NUT_MATRIX_TAG="c99-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++98"
1262 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-7-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc-7 CXX=g++-7
1263   - env: NUT_MATRIX_TAG="c99-clang-5.0-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang-5.0 CXX=clang++-5.0
1264   - env: NUT_MATRIX_TAG="c11-clang-5.0-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c11" CXXFLAGS="-std=c++11" CC=clang-5.0 CXX=clang++-5.0
1265   - env: NUT_MATRIX_TAG="c11-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c11" CXXFLAGS="-std=c++11"
1266 #OK#  - env: NUT_MATRIX_TAG="gnu11-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu11" CXXFLAGS="-std=gnu++11"
1267 #OK#  - env: NUT_MATRIX_TAG="gnu89-gcc-default-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu89" CXXFLAGS="-std=gnu++89"
1268   - env: NUT_MATRIX_TAG="c89-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c89" CXXFLAGS="-std=c++89"
1269   - env: NUT_MATRIX_TAG="gnu89-gcc-default-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu89" CXXFLAGS="-std=gnu++89"
1271 ### Linux on s390x (BigEndian)
1272 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn-s390x-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
1273 #OK#  - env: NUT_MATRIX_TAG="gnu17-gcc-9-nowarn-s390x-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
1274 #OK#  - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn-s390x-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
1275   - env: NUT_MATRIX_TAG="gnu17-clang-8-warn-s390x-64bit" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
1277 ### Linux on ARM
1278 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-default-nowarn-ARM-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98"
1279 #OK#  - env: NUT_MATRIX_TAG="gnu17-gcc-9-nowarn-ARM-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc-9 CXX=g++-9
1280   - env: NUT_MATRIX_TAG="gnu17-clang-8-nowarn-ARM-64bit" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang-8 CXX=clang++-8
1282 ### FreeBSD on x86_64
1283 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc CXX=g++
1284 #OK#  - env: NUT_MATRIX_TAG="gnu99-clang-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
1285 #OK#  - env: NUT_MATRIX_TAG="gnu17-gcc-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++17" CC=gcc CXX=g++
1286 #OK#  - env: NUT_MATRIX_TAG="gnu17-clang-freebsd-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
1287 #OK#  - env: NUT_MATRIX_TAG="gnu99-gcc-default-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++98" CC=gcc CXX=g++
1288 #OK#  - env: NUT_MATRIX_TAG="gnu17-gcc-default-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=gcc CXX=g++
1289   - env: NUT_MATRIX_TAG="gnu99-clang-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
1290   - env: NUT_MATRIX_TAG="gnu17-clang-freebsd-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
1292 ### macosx
1293 #OK#  - env: NUT_MATRIX_TAG="gnu99-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
1294 #OK#  - env: NUT_MATRIX_TAG="gnu17-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
1295 #OK#  - env: NUT_MATRIX_TAG="gnu99-clang-xcode7.3-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
1296   - env: NUT_MATRIX_TAG="gnu99-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
1297   - env: NUT_MATRIX_TAG="gnu17-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=gnu17" CXXFLAGS="-std=gnu++17" CC=clang CXX=clang++
1298   - env: NUT_MATRIX_TAG="c99-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1299   - env: NUT_MATRIX_TAG="c99-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1300   - env: NUT_MATRIX_TAG="c17-clang-xcode10.2-nowarn" BUILD_TYPE=default-all-errors CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang CXX=clang++
1301   - env: NUT_MATRIX_TAG="c17-clang-xcode10.2-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c17" CXXFLAGS="-std=c++17" CC=clang CXX=clang++
1302   - env: NUT_MATRIX_TAG="c11-clang-xcode7.3-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c11" CXXFLAGS="-std=c++11" CC=clang CXX=clang++
1304 ### windows on x86_64
1305   - env: NUT_MATRIX_TAG="gnu99-clang-win-nowarn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" CFLAGS="-std=gnu99" CXXFLAGS="-std=gnu++99" CC=clang CXX=clang++
1306   - env: NUT_MATRIX_TAG="gnu99-clang-win-warn" BUILD_TYPE=default-all-errors BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1307   - env: NUT_MATRIX_TAG="c99-clang-win-nowarn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1308   - env: NUT_MATRIX_TAG="c99-clang-win-warn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c99" CXXFLAGS="-std=c++99" CC=clang CXX=clang++
1309   - env: NUT_MATRIX_TAG="c20-clang-win-warn" BUILD_TYPE=default-all-errors CPPFLAGS="-fms-extensions" BUILD_WARNFATAL=yes BUILD_WARNOPT=hard CFLAGS="-std=c20" CXXFLAGS="-std=c++20" CC=clang CXX=clang++
1311 before_install:
1312 - |-
1313   if [ $TRAVIS_OS_NAME = "osx" ] ; then
1314     [ -n "$HOMEBREW_NO_AUTO_UPDATE" ] || HOMEBREW_NO_AUTO_UPDATE="$CI_DEFAULT_HOMEBREW_NO_AUTO_UPDATE"
1315     if [ "$HOMEBREW_NO_AUTO_UPDATE" = 1 ] ; then
1316         echo "NOT CALLING 'brew update' as it takes too long and cleans up preinstalled env"
1317         export HOMEBREW_NO_AUTO_UPDATE
1318     else
1319         unset HOMEBREW_NO_AUTO_UPDATE
1320         brew update
1321     fi
1322     brew install binutils ccache gd
1323     if [ "$BUILD_TYPE" = default-withdoc ] ; then
1324         brew install asciidoc docbook-xsl
1325         XML_CATALOG_FILES=/usr/local/etc/xml/catalog
1326         export XML_CATALOG_FILES
1327     fi
1328   fi
1330 # Please forgive the funny syntax below to dance around
1331 # both YAML escaping and windows-acceptable shell syntax
1332 - |-
1333     if [[ $TRAVIS_OS_NAME == "windows" ]] ; then
1334         if [[ ! -s C:/tools/cygwin/bin/autoreconf.exe ]] ; then
1335             if [[ ! -s C:/tools/cygwin/bin/autoreconf ]] ; then
1336                 choco install cygwin
1337                 C:\\tools\\cygwin\\cygwinsetup.exe -q -P make,unzip,automake,autoconf,zip
1338             fi
1339         fi
1340         if [[ ! -s C:/tools/bin/ccache.exe ]] ; then
1341             mkdir -p C:/tools/bin/
1342             pushd C:/tools/bin/ || exit
1343                 wget https://github.com/ccache/ccache/releases/download/v3.7.12/ccache-3.7.12-windows-64.zip || exit
1344                 7z e -y ccache-3.7.12-windows-64.zip || exit
1345                 rm -f ccache-3.7.12-windows-64.zip
1346             popd
1347         fi
1348         export PATH=/C/tools/bin:/cygdrive/c/tools/bin:$PATH:/C/tools/cygwin/bin:/cygdrive/c/tools/cygwin/bin
1349         CI_TRACE=true
1350         CI_TIME=false
1351         ( echo "user::rwx"
1352           echo "group::r--"
1353           echo "mask:rwx"
1354           echo "other:r--"
1355         ) > /tmp/faclx
1356         if ! setfacl -f /tmp/faclx /cygdrive/c/tools/cygwin/*bin/* ; then
1357             setfacl -f /tmp/faclx /C/tools/cygwin/*bin/*
1358         fi
1359     fi
1360 - if [ "$TRAVIS_OS_NAME" = "freebsd" ] ; then sudo pkg install -y libgd ; fi
1361 - if [ -n "${NUT_MATRIX_TAG}" ] ; then export CFLAGS CXXFLAGS ; [ -z "$CC" ] || export CC ; [ -z "$CXX" ] || export CXX ; fi
1363 # Hand off to generated script for each BUILD_TYPE
1364 script: ./ci_build.sh