language: nix

env:
  - EMACS_CI=emacs-25-3
  - EMACS_CI=emacs-26-3
  - EMACS_CI=emacs-snapshot

install:
  # mu4e
  - sudo apt-get -qq update
  - sudo apt-get install -y maildir-utils
  - pushd /tmp
  - wget https://github.com/djcb/mu/releases/download/v1.0/mu-1.0.tar.xz
  - tar xJvf mu-1.0.tar.xz
  - sudo cp -r mu-1.0/mu4e /usr/share/emacs/site-lisp/
  - popd

  # GNU Emacs itself through nix.
  - bash <(curl https://raw.githubusercontent.com/purcell/nix-emacs-ci/master/travis-install)

  # Install the soria theme, which has been previously downloaded.
  - git clone https://github.com/mssola/soria.git
  - cp soria/soria-theme.el .emacs.d/soria-theme.el

  # writer-mode
  - mkdir -p $HOME/src/github.com/mssola/
  - cd $HOME/src/github.com/mssola/
  - git clone https://github.com/mssola/writer-mode.git

  # Linters: shellcheck (shell) and rubocop (ruby).
  - sudo apt-get install -y shellcheck ruby
  - gem install rubocop

script:
  - cd $TRAVIS_BUILD_DIR
  - make test
