On top of #862.
This PR adds Cirrus CI integration. For now this is intended to replicate the functionality that we have in Travis currently. These are a lot of builds, we should also rethink the build matrix. Moreover, the CI shell script could have some refactoring and cleaning but these issues tasks are for another PR (see also #707).
Cirrus CI is relies on Docker images for Linux builds. We make use of this extensively by building our own Docker images (with necessary packages) on which CI then runs (https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment), see the dockerfile
setting in .cirrus.yml
. The image is recreated for every build and then all “tasks” run on this image.
For the Linux builds, NixOs is used. This is a rather uncommon choice. My intention of this is that it gives you an easy way of opening a shell on your local machine that has the build tools exactly as in the CI environment. (Just install the nix package manager on top of your distro and run the command from the .cirrus.yml
. Now after playing around with Nix, I’m not so convinced anymore:
- Not many people are familiar with Nix (these is my first usage of Nix), only @jonasnick here knows more.
- Support for cross-compilers is somewhat limited.
- As we anyway have docker, there’s already a nice way to replicate the CI environment locally.
Still, I kept Nix for now since it’s working now.
Debian is already used for a s390x big-endian qemu test. I choose s390x over the more common PowerPC and others because s390x is the only officially supported big-endian port of Debian (https://www.debian.org/ports/).
On the MacOS builds, we use a forked valgrind version which support newer macOS versions (https://github.com/LouisBrunner/valgrind-macos). It’s not great but it works and this was change was overdue anyway.
Todo (in this PR):
- Add build badge
- Enable caching of brew binaries for macOS (note that the macOS builds on Cirrus don’t use Docker)
Todo (other PRs)
- Reduce/reorganize jobs
- Tidy cirrus.sh script
- Add windows/MSVC
- Maybe add “bleeding edge” jobs that are allowed to fail and test against latest compilers.