language: c

# Based from: https://github.com/greghendershott/travis-racket

# Optional: Remove to use Travis CI's older infrastructure.
sudo: false

env:
  global:
    # Supply a global RACKET_DIR environment variable. This is where
    # Racket will be installed. A good idea is to use ~/racket because
    # that doesn't require sudo to install and is therefore compatible
    # with Travis CI's newer container infrastructure.
    - RACKET_DIR=~/racket
  matrix:
    # Supply at least one RACKET_VERSION environment variable. This is
    # used by the install-racket.sh script (run at before_install,
    # below) to select the version of Racket to download and install.
    #
    # Supply more than one RACKET_VERSION (as in the example below) to
    # create a Travis-CI build matrix to test against multiple Racket
    # versions.
    #- RACKET_VERSION=6.0
    #- RACKET_VERSION=6.1
    #- RACKET_VERSION=6.1.1
    #- RACKET_VERSION=6.2
    - RACKET_VERSION=6.3
    - RACKET_VERSION=6.4
    - RACKET_VERSION=6.5
    - RACKET_VERSION=6.6
    - RACKET_VERSION=HEAD

matrix:
  allow_failures:
  fast_finish: true

before_install:
- git clone https://github.com/greghendershott/travis-racket.git
- cat travis-racket/install-racket.sh | bash # pipe to bash not sh!
- export PATH="${RACKET_DIR}/bin:${PATH}" #install-racket.sh can't set for us

install:
 - raco pkg install --deps search-auto

before_script:

# Here supply steps such as raco make, raco test, etc. You can run
# `raco pkg install --deps search-auto` to install any required
# packages without it getting stuck on a confirmation prompt.
script:
 - raco test -p scribble-enhanced
 - raco setup --check-pkg-deps --no-zo --no-launcher --no-install --no-post-install --no-docs --pkgs scribble-enhanced

after_success:
 - raco pkg install --deps search-auto cover cover-coveralls
 - raco cover -b -f coveralls -d $TRAVIS_BUILD_DIR/coverage .