1
+ # This is the complex Travis configuration, which is intended for use
2
+ # on open source libraries which need compatibility across multiple GHC
3
+ # versions, must work with cabal-install, and should be
4
+ # cross-platform. For more information and other options, see:
5
+ #
6
+ # https://docs.haskellstack.org/en/stable/travis_ci/
7
+ #
1
8
# Copy these contents into the root directory of your Github project in a file
2
9
# named .travis.yml
3
10
4
11
# Use new container infrastructure to enable caching
5
12
sudo : false
6
13
7
- # Choose a lightweight base image ; we provide our own build tools.
8
- language : c
14
+ # Do not choose a language ; we provide our own build tools.
15
+ language : generic
9
16
10
17
# Caching so the next build will be fast too.
11
18
cache :
12
19
directories :
13
20
- $HOME/.ghc
14
21
- $HOME/.cabal
15
22
- $HOME/.stack
23
+ - $TRAVIS_BUILD_DIR/.stack-work
16
24
17
25
# The different configurations we want to test. We have BUILD=cabal which uses
18
26
# cabal-install, and BUILD=stack which uses Stack. More documentation on each
@@ -29,14 +37,32 @@ matrix:
29
37
# are finished building. Don't wait for the "allowed_failures" to finish.
30
38
fast_finish : true
31
39
include :
40
+ # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
41
+ # https://github.com/hvr/multi-ghc-travis
42
+ # - env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
43
+ # compiler: ": #GHC 7.0.4"
44
+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
45
+ # - env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
46
+ # compiler: ": #GHC 7.2.2"
47
+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
48
+ # - env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
49
+ # compiler: ": #GHC 7.4.2"
50
+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
51
+ # - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
52
+ # compiler: ": #GHC 7.6.3"
53
+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
54
+ # - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
55
+ # compiler: ": #GHC 7.8.4"
56
+ # addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
57
+ # - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
58
+ # compiler: ": #GHC 7.10.3"
59
+ # addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
32
60
- env : BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
33
61
compiler : " : #GHC 8.0.2"
34
62
addons : {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
35
-
36
63
- env : BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
37
64
compiler : " : #GHC 8.2.2"
38
65
addons : {apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
39
-
40
66
- env : BUILD=cabal GHCVER=8.4.1 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
41
67
compiler : " : #GHC 8.4.1"
42
68
addons : {apt: {packages: [cabal-install-2.0,ghc-8.4.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
@@ -47,25 +73,67 @@ matrix:
47
73
compiler : " : #GHC HEAD"
48
74
addons : {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
49
75
50
- # The Stack LTS builds.
51
-
52
- # Build using the configuration specified in the stack.yaml file in the
53
- # current directory.
76
+ # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
77
+ # variable, such as using --stack-yaml to point to a different file.
54
78
- env : BUILD=stack ARGS=""
55
79
compiler : " : #stack default"
56
80
addons : {apt: {packages: [libgmp-dev]}}
57
81
82
+ # - env: BUILD=stack ARGS="--resolver lts-2"
83
+ # compiler: ": #stack 7.8.4"
84
+ # addons: {apt: {packages: [libgmp-dev]}}
85
+
86
+ # - env: BUILD=stack ARGS="--resolver lts-3"
87
+ # compiler: ": #stack 7.10.2"
88
+ # addons: {apt: {packages: [libgmp-dev]}}
89
+
90
+ # - env: BUILD=stack ARGS="--resolver lts-6"
91
+ # compiler: ": #stack 7.10.3"
92
+ # addons: {apt: {packages: [libgmp-dev]}}
93
+
94
+ # - env: BUILD=stack ARGS="--resolver lts-7"
95
+ # compiler: ": #stack 8.0.1"
96
+ # addons: {apt: {packages: [libgmp-dev]}}
97
+
98
+ # - env: BUILD=stack ARGS="--resolver lts-9"
99
+ # compiler: ": #stack 8.0.2"
100
+ # addons: {apt: {packages: [libgmp-dev]}}
101
+
58
102
- env : BUILD=stack ARGS="--resolver lts-11"
59
103
compiler : " : #stack 8.2.2"
60
104
addons : {apt: {packages: [libgmp-dev]}}
61
105
62
-
63
106
# Nightly builds are allowed to fail
64
107
- env : BUILD=stack ARGS="--resolver nightly"
65
108
compiler : " : #stack nightly"
66
109
addons : {apt: {packages: [libgmp-dev]}}
67
110
68
- # Build on OS X with Stack in addition to Linux.
111
+ # Build on macOS in addition to Linux
112
+ - env : BUILD=stack ARGS=""
113
+ compiler : " : #stack default osx"
114
+ os : osx
115
+
116
+ # Travis includes an macOS which is incompatible with GHC 7.8.4
117
+ # - env: BUILD=stack ARGS="--resolver lts-2"
118
+ # compiler: ": #stack 7.8.4 osx"
119
+ # os: osx
120
+
121
+ # - env: BUILD=stack ARGS="--resolver lts-3"
122
+ # compiler: ": #stack 7.10.2 osx"
123
+ # os: osx
124
+
125
+ # - env: BUILD=stack ARGS="--resolver lts-6"
126
+ # compiler: ": #stack 7.10.3 osx"
127
+ # os: osx
128
+
129
+ # - env: BUILD=stack ARGS="--resolver lts-7"
130
+ # compiler: ": #stack 8.0.1 osx"
131
+ # os: osx
132
+
133
+ # - env: BUILD=stack ARGS="--resolver lts-9"
134
+ # compiler: ": #stack 8.0.2 osx"
135
+ # os: osx
136
+
69
137
- env : BUILD=stack ARGS="--resolver lts-11"
70
138
compiler : " : #stack 8.2.2 osx"
71
139
os : osx
@@ -75,8 +143,8 @@ matrix:
75
143
os : osx
76
144
77
145
allow_failures :
78
- - env : BUILD=stack ARGS="--resolver nightly"
79
146
- env : BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
147
+ - env : BUILD=stack ARGS="--resolver nightly"
80
148
- os : osx
81
149
82
150
before_install :
@@ -93,20 +161,16 @@ before_install:
93
161
- |
94
162
if [ `uname` = "Darwin" ]
95
163
then
96
- travis_retry curl --insecure -L https://www.stackage .org/stack /osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
164
+ travis_retry curl --insecure -L https://get.haskellstack .org/stable /osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
97
165
else
98
- travis_retry curl -L https://www.stackage .org/stack /linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
166
+ travis_retry curl -L https://get.haskellstack .org/stable /linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
99
167
fi
100
168
101
169
# Use the more reliable S3 mirror of Hackage
102
170
mkdir -p $HOME/.cabal
103
171
echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
104
172
echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
105
173
106
- if [ "$CABALVER" != "1.16" ]
107
- then
108
- echo 'jobs: $ncpus' >> $HOME/.cabal/config
109
- fi
110
174
111
175
install :
112
176
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
@@ -160,10 +224,13 @@ script:
160
224
cd "$PKGVER"
161
225
cabal configure --enable-tests --ghc-options -O0 --flags="buildexample"
162
226
cabal build
163
- cabal test
227
+ if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then
228
+ cabal test
229
+ else
230
+ cabal test --show-details=streaming --log=/dev/stdout
231
+ fi
164
232
cd $ORIGDIR
165
233
done
166
234
;;
167
235
esac
168
236
set +ex
169
-
0 commit comments