Explicitly specify copy on windows
[lsp-test.git] / .travis.yml
index 944f816be887a1e51eaf70831ddf02b7a7ab8a35..3f113ef4224a03d1b9ae3900dc02bee0aff25157 100644 (file)
@@ -1,7 +1,13 @@
-language: haskell
-dist: xenial
+language: c
 sudo: false
 
+os:
+- linux
+- osx
+- windows
+
+dist: xenial
+
 ghc:
 - 8.6.5
 cabal: '2.4'
@@ -9,33 +15,73 @@ cabal: '2.4'
 cache:
   directories:
   - "$HOME/.cabal"
+  - "$HOME/.ghc"
   - "$HOME/haskell-ide-engine/dist-newstyle"
   - "dist-newstyle"
-  timeout: 1000
 
 addons:
   apt:
+    sources:
+    - sourceline: ppa:hvr/ghc
     packages:
     - npm
+    - ghc-8.6.5
+    - cabal-install-2.4
+  homebrew:
+    packages:
+    - ghc
+    - cabal-install
+    - npm
+    update: true
 
 before_install:
-- mkdir -p haskell-ide-engine
-- cd $HOME/haskell-ide-engine
+- |
+  if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
+    choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
+    choco install cabal-head -pre
+    choco install ghc --ignore-dependencies
+    choco install nodejs
+    /C/ProgramData/chocolatey/bin/RefreshEnv.cmd
+    export PATH=/C/ProgramData/chocolatey/lib/ghc/tools/ghc-8.6.5/bin:${PATH}
+  fi
+# these are taken from the haskell language setup
+- export PATH=/opt/ghc/8.6.5/bin:${PATH}
+- export PATH=/opt/cabal/2.4/bin:${PATH}
+- export PATH=$HOME/.cabal/bin:${PATH}
+- ghc --version
+- mkdir -p $HOME/haskell-ide-engine
+- pushd $HOME/haskell-ide-engine
 - git init
 - git remote add origin https://github.com/haskell/haskell-ide-engine.git
 - git pull origin master
 - git checkout abdb097f39e135deaf321a604c95f16cbda32678
 - git submodule update --init
-- cabal v2-install hie -j2
-- cabal v2-run -j2 hoogle generate
-- cd $TRAVIS_BUILD_DIR
+- cabal v2-update
+- cabal --version
+- |
+  if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
+    cabal v2-install hie -j2 --overwrite-policy=always --install-method=copy --installdir=~/.cabal/bin
+  else
+    cabal v2-install hie -j2 --overwrite-policy=always
+  fi
+- |
+  if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
+    cabal v2-install hoogle -j2 --overwrite-policy=always --install-method=copy --installdir=~/.cabal/bin
+  else
+    cabal v2-install hoogle -j2 --overwrite-policy=always
+  fi
+- hoogle generate
+- popd
+# needs to be old-install for cabal-helper to find it
+- cabal install Cabal --constraint "Cabal == 2.4.1.0"
 - npm update
 - npm i -g javascript-typescript-langserver
 
 install:
 - cabal v2-build
 script:
-- cabal v2-test
+# until cabal v2-test supports streaming results
+- cabal v2-run lsp-test:test:tests
 
 deploy:
   - provider: hackage
@@ -54,4 +100,3 @@ deploy:
       tags: true
       branch: master
       repo: bubba/lsp-test
-