dist: trusty
# Require sudo because Emacs needs to disable ASLR to dump, only
# possible on sudo-enabled environment.  See also
# https://github.com/travis-ci/travis-ci/issues/9061.
sudo: required
language: emacs-lisp
cache:
  - directories:
      # Cache stable Emacs binaries (saves 1min per job)
      - "$HOME/emacs/"
      - "$HOME/.roswell/"

env:
  - "TARGET=check-core        ROSWELL_LISP=sbcl-bin/1.2.14 EMACS_VERSION=25.2"
  - "TARGET=check-fancy       ROSWELL_LISP=sbcl-bin/1.2.14 EMACS_VERSION=25.2"
  - "TARGET=check-fancy       ROSWELL_LISP=ccl-bin         EMACS_VERSION=26.1"
  - "TARGET=check-core        ROSWELL_LISP=ccl-bin         EMACS_VERSION=26.1"
  - "TARGET=check-mrepl       ROSWELL_LISP=sbcl-bin/1.2.14 EMACS_VERSION=26.1"
  - "TARGET=check-indentation ROSWELL_LISP=sbcl-bin/1.2.14 EMACS_VERSION=26.1"
  - "TARGET=check-core        ROSWELL_LISP=sbcl-bin/1.2.14 EMACS_VERSION=26.1"
  - "TARGET=check-fancy       ROSWELL_LISP=sbcl-bin/1.2.14 EMACS_VERSION=26.1"

before_install:
  - wget 'https://raw.githubusercontent.com/flycheck/emacs-travis/master/emacs-travis.mk'
  - make -f emacs-travis.mk install_emacs
  - export ROSWELL_INSTALL_DIR=~/.roswell && mkdir -p $ROSWELL_INSTALL_DIR
  - export PATH=$ROSWELL_INSTALL_DIR/bin:$PATH
  - export LISP=$ROSWELL_LISP
  - curl -L https://raw.githubusercontent.com/snmsts/roswell/release/scripts/install-for-ci.sh | sh

script:
  - make LISP="ros run -L $ROSWELL_LISP" EMACS=$HOME/emacs/$EMACS_VERSION/src/emacs $TARGET
