|
1 |
| -# See https://github.com/hvr/multi-ghc-travis |
| 1 | +sudo: false |
2 | 2 |
|
3 |
| -notifications: |
4 |
| - email: false |
5 |
| - |
6 |
| -env: |
7 |
| - - GHCVER=7.10.1 CABALVER=1.22 |
8 |
| - - GHCVER=head CABALVER=1.22 |
9 |
| - |
10 |
| -matrix: |
11 |
| - allow_failures: |
12 |
| - - env: GHCVER=head CABALVER=1.22 |
| 3 | +# Caching so the next build will be fast too. |
| 4 | +cache: |
| 5 | + directories: |
| 6 | + - $HOME/.stack |
13 | 7 |
|
| 8 | +# Download and unpack the stack executable |
14 | 9 | before_install:
|
15 |
| - - travis_retry sudo add-apt-repository -y ppa:hvr/ghc |
16 |
| - - travis_retry sudo apt-get update |
17 |
| - - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER |
18 |
| - - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH |
19 |
| - - cabal --version |
| 10 | + - mkdir -p ~/.local/bin |
| 11 | + - export PATH=$HOME/.local/bin:$PATH |
| 12 | + - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' |
| 13 | + - stack config set system-ghc --global true |
| 14 | + - export PATH=/opt/ghc/7.10.2/bin:$PATH |
20 | 15 |
|
| 16 | +# Install GHC |
| 17 | +addons: |
| 18 | + apt: |
| 19 | + sources: |
| 20 | + - hvr-ghc |
| 21 | + packages: |
| 22 | + - ghc-7.10.2 |
| 23 | + |
| 24 | +# Avoid timeouts |
21 | 25 | install:
|
22 |
| - - cabal update |
23 |
| - - cabal install --only-dependencies -v2 |
| 26 | + - travis_wait stack --no-terminal --skip-ghc-check setup |
| 27 | + - travis_wait stack --no-terminal --skip-ghc-check test --only-snapshot |
24 | 28 |
|
| 29 | +# Run the tests |
25 | 30 | script:
|
26 |
| - - cabal configure -v2 |
27 |
| - - cabal build |
28 |
| - - cabal check |
29 |
| - - cabal sdist |
30 |
| - |
31 |
| -# The following scriptlet checks that the resulting source distribution can be built & installed |
32 |
| - - export SRC_TGZ=$(cabal-$CABALVER info . | awk '{print $2 ".tar.gz";exit}') ; |
33 |
| - cd dist/; |
34 |
| - if [ -f "$SRC_TGZ" ]; then |
35 |
| - cabal install "$SRC_TGZ"; |
36 |
| - else |
37 |
| - echo "expected '$SRC_TGZ' not found"; |
38 |
| - exit 1; |
39 |
| - fi |
| 31 | + - stack --no-terminal --skip-ghc-check test --fast |
0 commit comments