|
1 | 1 | language: c |
2 | | -dist: trusty |
| 2 | +dist: trusty # because of perf issues |
3 | 3 | sudo: required |
4 | 4 | matrix: |
5 | 5 | include: |
6 | | - - env: GHCVER=7.10.3 CABALVER=1.22 STACKAGE=lts-5.4 RUNSDISTTESTS=YES |
7 | | - compiler: ": #GHC 7.10.3 lts-5.4" |
8 | | - addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}} |
9 | | - - env: GHCVER=7.10.3 CABALVER=1.22 STACKAGE=nightly-2016-02-25 |
10 | | - compiler: ": #GHC 7.10.3 nightly-2016-02-25" |
11 | | - addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}} |
12 | | - - env: GHCVER=7.10.3 CABALVER=1.22 DEPLOY=yes |
13 | | - compiler: ": #GHC 7.10.3" |
14 | | - addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}} |
15 | | -before_install: |
16 | | - - unset CC |
17 | | - - export PATH="/opt/ghc/$GHCVER/bin:$PATH" |
18 | | - - export PATH="/opt/cabal/$CABALVER/bin:$PATH" |
19 | | - - export PATH="$HOME/.cabal/bin:$PATH" |
20 | | - - export PATH="/opt/happy/1.19.5/bin:/$PATH" |
21 | | - - export PATH="/opt/alex/3.1.4/bin:/$PATH" |
22 | | - - export PATH="$HOME/build/purescript/purescript/dist/build/psc:/$PATH" |
23 | | - - export PATH="$HOME/build/purescript/purescript/dist/build/psc-ide-server:/$PATH" |
24 | | - - export PATH="$HOME/build/purescript/purescript/dist/build/psc-ide-client:/$PATH" |
| 6 | + # The 'compiler' key is a hack to get Travis to use different caches for |
| 7 | + # each job in a build, in order to avoid the separate jobs stomping on each |
| 8 | + # other's caches. See https://github.com/travis-ci/travis-ci/issues/4393 |
| 9 | + # |
| 10 | + # We use trusty boxes because they seem to be a bit faster. |
| 11 | + - compiler: cc-linux-lts-normal |
| 12 | + os: linux |
| 13 | + dist: trusty |
| 14 | + sudo: required |
| 15 | + env: BUILD_TYPE=normal COVERAGE=true DEPLOY=true |
| 16 | + |
| 17 | + # - compiler: cc-linux-nightly-normal |
| 18 | + # os: linux |
| 19 | + # dist: trusty |
| 20 | + # sudo: required |
| 21 | + # env: BUILD_TYPE=normal STACKAGE_NIGHTLY=true |
| 22 | + # allow_failures: true |
| 23 | + |
| 24 | + - compiler: cc-linux-lts-sdist |
| 25 | + os: linux |
| 26 | + dist: trusty |
| 27 | + sudo: required |
| 28 | + env: BUILD_TYPE=sdist |
| 29 | + |
| 30 | + - compiler: cc-linux-lts-haddock |
| 31 | + os: linux |
| 32 | + dist: trusty |
| 33 | + sudo: required |
| 34 | + env: BUILD_TYPE=haddock |
| 35 | + |
| 36 | + - compiler: cc-osx-lts-normal |
| 37 | + os: osx |
| 38 | + env: BUILD_TYPE=normal DEPLOY=true |
| 39 | + |
| 40 | + - compiler: cc-osx-lts-sdist |
| 41 | + os: osx |
| 42 | + env: BUILD_TYPE=sdist |
| 43 | +addons: |
| 44 | + apt: |
| 45 | + packages: |
| 46 | + - libgmp-dev |
| 47 | +cache: |
| 48 | + directories: |
| 49 | + - $HOME/.local/bin |
| 50 | + - $HOME/.stack |
25 | 51 | install: |
26 | | - - cabal --version |
27 | | - - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" |
28 | | - - travis_retry cabal update |
29 | | - # Run sequentially |
30 | | - # Travis container infrastructure seems to expose all host CPUs (16?), thus |
31 | | - # cabal and ghc tries to use them all. Which is bad idea on a shared box. |
32 | | - # See also: https://ghc.haskell.org/trac/ghc/ticket/9221 |
33 | | - - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config |
34 | | - # Cache sandboxes in ~/cabal-sandboxes |
35 | | - # Move right sandbox to .cabal-sandbox if exists |
36 | | - - if [ -d ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} ]; then |
37 | | - mv ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} .cabal-sandbox; |
38 | | - fi |
39 | | - - mkdir -p .cabal-sandbox |
40 | | - - cabal sandbox init --sandbox .cabal-sandbox |
41 | | - # Download stackage cabal.config. Filter this package and 'extra deps' |
42 | | - - if [ -n "$STACKAGE" ]; then curl https://www.stackage.org/$STACKAGE/cabal.config | egrep -v 'purescript|language-javascript|bower-json' > cabal.config; fi |
43 | | - - cabal install --only-dependencies --enable-tests |
44 | | - - cabal install hpc-coveralls |
45 | | - # Snapshot state of the sandbox now, so we don't need to make new one for test install |
46 | | - - rm -rf ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} |
47 | | - - cp -r .cabal-sandbox ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} |
48 | | - # Install bower globally (for psc-docs/psc-publish tests) |
49 | | - - npm install -g bower |
| 52 | +- | # Install stack. |
| 53 | + if test ! -f "$HOME/.local/bin/stack" |
| 54 | + then |
| 55 | + URL="https://www.stackage.org/stack/$TRAVIS_OS_NAME-x86_64" |
| 56 | + curl --location "$URL" > stack.tar.gz |
| 57 | + gunzip stack.tar.gz |
| 58 | + tar -x -f stack.tar --strip-components 1 |
| 59 | + mkdir -p "$HOME/.local/bin" |
| 60 | + mv stack "$HOME/.local/bin/" |
| 61 | + fi |
| 62 | +- npm install -g bower # for psc-docs / psc-publish tests |
| 63 | +# Fix the CC environment variable, because Travis changes it |
| 64 | +- export CC=gcc |
| 65 | +- export OS_NAME=$(./travis/convert-os-name.sh) |
50 | 66 | script: |
51 | | - - ./travis/configure.sh |
52 | | - - cabal build --ghc-options="-Werror" |
53 | | - - cabal test |
54 | | - - ./travis/test-install.sh |
55 | | -after_script: |
56 | | - - ./travis/after.sh |
57 | | -notifications: |
58 | | - email: true |
59 | | -before_deploy: "./bundle/build.sh linux64" |
| 67 | +- travis/build.sh |
| 68 | +before_deploy: |
| 69 | +- ./bundle/build.sh $OS_NAME |
60 | 70 | deploy: |
61 | 71 | provider: releases |
62 | 72 | api_key: $RELEASE_KEY |
63 | 73 | file: |
64 | | - - bundle/linux64.tar.gz |
65 | | - - bundle/linux64.sha |
| 74 | + - bundle/$OS_NAME.tar.gz |
| 75 | + - bundle/$OS_NAME.sha |
66 | 76 | skip_cleanup: true |
67 | 77 | on: |
68 | 78 | all_branches: true |
69 | 79 | tags: true |
70 | | - condition: "$DEPLOY = yes" |
71 | | -cache: |
72 | | - directories: |
73 | | - - ~/cabal-sandboxes |
| 80 | + condition: "$DEPLOY = true" |
0 commit comments