sudo: required

language: go

env:
  matrix:
  - BLAS_LIB=OpenBLAS
  - BLAS_LIB=gonum
  # Does not currently link correctly.  Note that there is an issue with drotgm in ATLAS.
  # - BLAS_LIB=ATLAS 
  # If we can get multiarch builds on travis.
  # There are some issues with the Accellerate implementation.
  #- BLAS_LIB=Accellerate 

# Versions of go that are explicitly supported by gonum.
go:
 - 1.5beta1
 - 1.3.3
 - 1.4.2

# Required for coverage.
before_install:
 - go get golang.org/x/tools/cmd/cover
 - go get github.com/mattn/goveralls

# Install the appropriate BLAS library.
install:
 - bash .travis/$TRAVIS_OS_NAME/$BLAS_LIB/install.sh

# Get deps, build, test, and ensure the code is gofmt'ed.
# If we are building as gonum, then we have access to the coveralls api key, so we can run coverage as well.
script:
 - if [[ "$BLAS_LIB" == "gonum" ]]; then pushd native; fi
 - go get -d -t -v ./...
 - go build -v ./...
 - go test -v ./...
 - diff <(gofmt -d *.go) <("")
 - if [[ $TRAVIS_SECURE_ENV_VARS = "true" ]]; then bash -c "${TRAVIS_BUILD_DIR}/.travis/test-coverage.sh"; fi
