on master help sign in
Merge branch 'travis-build-matrix' of https://github.com/diogob/project-m36 into diogob-travis-build-matrix
6b3a1f3AgentM
.travis.yml+6−11
@@ -16,36 +16,31 @@ cache:
16matrix:
16matrix:
17 fast_finish: true
17 fast_finish: true
18 include:
18 include:
19− - env: CACHE_NAME=7.10.3 STACK_YAML=stack.ghc7.10.yaml GHC_VERSION=7.10.3
19+ - env: CACHE_NAME=7.10.3 STACK_YAML=stack.ghc7.10.yaml
20 compiler: ": #stack 7.10.3"
20 compiler: ": #stack 7.10.3"
21− addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
22
21
23− - env: CACHE_NAME=8.0.2 STACK_YAML=stack.yaml GHC_VERSION=8.0.2
22+ - env: CACHE_NAME=8.0.2 STACK_YAML=stack.yaml
24 compiler: ": #stack 8.0.2"
23 compiler: ": #stack 8.0.2"
25− addons: {apt: {packages: [ghc-8.0.2], sources: [hvr-ghc]}}
26
24
27 - env: CACHE_NAME=osx-8.0.2 STACK_YAML=stack.yaml
25 - env: CACHE_NAME=osx-8.0.2 STACK_YAML=stack.yaml
28 os: osx
26 os: osx
29 os_image: xcode7.3
27 os_image: xcode7.3
30 compiler: ": #stack 8.0.2"
28 compiler: ": #stack 8.0.2"
31
29
32−install:
30+before_script:
33 - unset CC
31 - unset CC
34 - export PATH=$HOME/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH
32 - export PATH=$HOME/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH
35 - ./.travis/install-ghr.sh
33 - ./.travis/install-ghr.sh
36 - ./.travis/install-stack.sh
34 - ./.travis/install-stack.sh
37− - GHC_VERSION=$GHC_VERSION ./.travis/install-ghc.sh
38
35
39# Here starts the actual work to be performed for the package under test;
36# Here starts the actual work to be performed for the package under test;
40# any command which exits with a non-zero exit code causes the build to fail.
37# any command which exits with a non-zero exit code causes the build to fail.
41script:
38script:
42 - |
39 - |
43 # Run tests
40 # Run tests
44− if [[ "$(uname)" = "Linux" ]]; then
41+ set -e
45− stack --no-install-ghc --no-terminal --system-ghc test
42+ ./.travis/install-dependencies.sh
46− else #Darwin
43+ stack --no-terminal --jobs=2 --system-ghc test
47− stack --no-install-ghc --system-ghc --no-terminal build --dependencies-only project-m36:lib
48− fi
49 - |
44 - |
50 #Run HLint
45 #Run HLint
51 if [[ "$(uname)" = "Linux" ]]; then
46 if [[ "$(uname)" = "Linux" ]]; then
.travis/install-dependencies.shnew file+22
@@ -0,0 +1,22 @@
1+# Run tests
2+if [[ "$(uname)" = "Darwin" ]]; then
3+ timeout_cmd="gtimeout"
4+else
5+ timeout_cmd="timeout"
6+fi
7+$timeout_cmd 15m stack --no-terminal --jobs=2 --install-ghc --system-ghc build --only-dependencies --fast
8+ret=$?
9+case "$ret" in
10+ 0)
11+ # continue
12+ ;;
13+ 124)
14+ echo "Timed out while installing dependencies."
15+ echo "Try building again by pushing a new commit."
16+ exit 1
17+ ;;
18+ *)
19+ echo "Failed to install dependencies; stack exited with $ret"
20+ exit "$ret"
21+ ;;
22+esac