on master help sign in
Merge branch 'travis-build-matrix' of https://github.com/diogob/project-m36 into diogob-travis-build-matrix
commit6b3a1f3a7b7297df63f94e11110237fdf008482c authorAgentM <agentm@themactionfaction.com> dateFri 12 Jan 2018, 20:50 (9 years ago) parent38e031e0fc9e09
2 files changed+28−11
.travis.yml+6−11 .travis/install-dependencies.sh+22
.travis.yml+6−11
@@ -16,36 +16,31 @@ cache:
1616matrix:
1717 fast_finish: true
1818 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
2020 compiler: ": #stack 7.10.3"
21− addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
2221
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
2423 compiler: ": #stack 8.0.2"
25− addons: {apt: {packages: [ghc-8.0.2], sources: [hvr-ghc]}}
2624
2725 - env: CACHE_NAME=osx-8.0.2 STACK_YAML=stack.yaml
2826 os: osx
2927 os_image: xcode7.3
3028 compiler: ": #stack 8.0.2"
3129
32−install:
30+before_script:
3331 - unset CC
3432 - export PATH=$HOME/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH
3533 - ./.travis/install-ghr.sh
3634 - ./.travis/install-stack.sh
37− - GHC_VERSION=$GHC_VERSION ./.travis/install-ghc.sh
3835
3936# Here starts the actual work to be performed for the package under test;
4037# any command which exits with a non-zero exit code causes the build to fail.
4138script:
4239 - |
4340 # Run tests
44− if [[ "$(uname)" = "Linux" ]]; then
45− stack --no-install-ghc --no-terminal --system-ghc test
46− else #Darwin
47− stack --no-install-ghc --system-ghc --no-terminal build --dependencies-only project-m36:lib
48− fi
41+ set -e
42+ ./.travis/install-dependencies.sh
43+ stack --no-terminal --jobs=2 --system-ghc test
4944 - |
5045 #Run HLint
5146 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