# Use a minimal base image.
language: c

# Do not build other branches than these, pull requests get built anyway, and in
# the end it is only the result of the testing branch that matters. In theory
# the commits that get pushed to master should have been built in testing
# already, but sometimes I still push manually, and of course the evergreen
# build status badge needs to come from somewhere.
branches:
  only:
  - master
  - testing

# Do not spam me with build status emails.
notifications:
  email: false

# The 'stack' package is not (yet) whitelisted on Travis CI, so we need sudo to
# be able to install it. This does mean that we get a VM instead of a container,
# which is slower to boot. But 20 seconds on a ~dozen minute build is not that
# much, and it simplifies things a bit.
sudo: required

# Use a slightly less ancient Ubuntu version than the default.
dist: trusty

cache:
  directories:
  - $HOME/.stack/
  - $TRAVIS_BUILD_DIR/.stack-work/

addons:
  apt:
    sources:
    - fpcomplete-precise
    packages:
    - stack

install:
  - stack setup --no-terminal

script:
  - stack build -j2 --no-terminal
  - stack test -j2 --no-terminal

  # As CI is running on a Debian-like system, test building
  # the package here too.
  - cd package && VERSION=0.0.0 ./build-package.sh

language: nix

# Do not build other branches than these, pull requests get built anyway, and in
# the end it is only the result of the testing branch that matters. In theory
# the commits that get pushed to master should have been built in testing
# already, but sometimes I still push manually, and of course the evergreen
# build status badge needs to come from somewhere.
branches:
  only:
  - master
  - testing

# Do not spam me with build status emails.
notifications:
  email: false

cache:
  directories:
  - $HOME/.stack/
  - $TRAVIS_BUILD_DIR/.stack-work/

Use Nix for CI builds
Use Nix for CI builds

Installing Stack on Travis failed. This script was very old, and things
tend to break after a while if you don't use Nix. So let's use Nix
everywhere. Builds are going to take a very long time then. Caching the
Nix store will fail I believe, I ran into that with Miniserver. It was
something related to permissions if I recall correctly. I should look
into Cachix.
