# Use Trusty as Emacs 26.x is failing on Xenial
# https://github.com/rejeep/evm/issues/125
dist: trusty

language: generic
sudo: false

cache:
  directories:
    - emacs-25.3

before_install:
  - ./download_emacs_src.sh

  - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
  - evm install $EVM_EMACS --use --skip
  - cask
env:
  - EVM_EMACS=emacs-25.1-travis
  - EVM_EMACS=emacs-25.2-travis
  - EVM_EMACS=emacs-25.3-travis
  - EVM_EMACS=emacs-26.1-travis
  - EVM_EMACS=emacs-26.2-travis
  # - EVM_EMACS=emacs-git-snapshot-travis
script:
  - emacs --version
  # Test interpreted code.
  - cask exec ert-runner
  # Test compiled code.
  - cask build
  - cask exec ert-runner

notifications:
  email: false

matrix:
  fast_finish: true
  allow_failures:
    - env: EVM_EMACS=emacs-git-snapshot-travis
