sudo: required
dist: xenial

os:
  - linux
# TODO https://github.com/Microsoft/vscode-mssql/issues/1004 reenable OSX once travis issue is fixed
#  - osx

mono: none
dotnet: 2.2
# was dotnet: 2.2.100-preview3-009430

# safelist
branches:
  only:
    - master
    - dev

language: csharp
solution: sqltoolsservice.sln

env:
  # Since we are building from root, current directory is the project path
  - ProjectPath=$TRAVIS_BUILD_DIR
  - HOMEBREW_NO_AUTO_UPDATE=1
before_install:
  - if [ $TRAVIS_OS_NAME == "linux" ]; then
      sudo apt-get update;
      sudo apt-get install dotnet-sdk-2.2;
    else
      brew update;
    fi

install:
  - dotnet restore

script:
  - dotnet build src/Microsoft.SqlTools.ServiceLayer
  - dotnet test test/Microsoft.SqlTools.ServiceLayer.UnitTests
  - dotnet build src/Microsoft.SqlTools.CoreServices
  - dotnet test test/Microsoft.SqlTools.Hosting.UnitTests