on master help sign in
Update CI config
commitbe570023d61ea52dd556157d4cb33c7d76326262 authorMichael Snoyman <michael@snoyman.com> dateSun 19 Aug 2018, 06:47 (8 years ago) parent9d36b50
2 files changed+113−35
.travis.yml+76−35 appveyor.yml+37
.travis.yml+76−35
@@ -11,8 +11,8 @@
1111# Use new container infrastructure to enable caching
1212sudo: false
1313
14−# Choose a lightweight base image; we provide our own build tools.
15−language: c
14+# Do not choose a language; we provide our own build tools.
15+language: generic
1616
1717# Caching so the next build will be fast too.
1818cache:
@@ -20,6 +20,7 @@ cache:
2020 - $HOME/.ghc
2121 - $HOME/.cabal
2222 - $HOME/.stack
23+ - $TRAVIS_BUILD_DIR/.stack-work
2324
2425# The different configurations we want to test. We have BUILD=cabal which uses
2526# cabal-install, and BUILD=stack which uses Stack. More documentation on each
@@ -33,15 +34,35 @@ cache:
3334# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
3435matrix:
3536 include:
37+ # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
38+ # https://github.com/hvr/multi-ghc-travis
39+ #- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
40+ # compiler: ": #GHC 7.0.4"
41+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
42+ #- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
43+ # compiler: ": #GHC 7.2.2"
44+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
45+ #- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
46+ # compiler: ": #GHC 7.4.2"
47+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
48+ #- env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
49+ # compiler: ": #GHC 7.6.3"
50+ # addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
51+ #- env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
52+ # compiler: ": #GHC 7.8.4"
53+ # addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
3654 - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
3755 compiler: ": #GHC 7.10.3"
3856 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
3957 - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
4058 compiler: ": #GHC 8.0.2"
4159 addons: {apt: {packages: [libfcgi-dev,cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
42− - env: BUILD=cabal GHCVER=8.2.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
60+ - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
4361 compiler: ": #GHC 8.2.2"
44− addons: {apt: {packages: [libfcgi-dev,cabal-install-1.24,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
62+ addons: {apt: {packages: [libfcgi-dev,cabal-install-2.0,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
63+ - env: BUILD=cabal GHCVER=8.4.3 CABALVER=2.2 HAPPYVER=1.19.5 ALEXVER=3.1.7
64+ compiler: ": #GHC 8.4.3"
65+ addons: {apt: {packages: [libfcgi-dev,cabal-install-2.2,ghc-8.4.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
4566
4667 # Build with the newest GHC and cabal-install. This is an accepted failure,
4768 # see below.
@@ -51,9 +72,9 @@ matrix:
5172
5273 # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
5374 # variable, such as using --stack-yaml to point to a different file.
54− #- env: BUILD=stack ARGS=""
55− # compiler: ": #stack default"
56− # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
75+ - env: BUILD=stack ARGS=""
76+ compiler: ": #stack default"
77+ addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
5778
5879 #- env: BUILD=stack ARGS="--resolver lts-2"
5980 # compiler: ": #stack 7.8.4"
@@ -75,21 +96,25 @@ matrix:
7596 compiler: ": #stack 8.0.2"
7697 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
7798
78− - env: BUILD=stack ARGS="--resolver lts-10"
99+ - env: BUILD=stack ARGS="--resolver lts-11"
79100 compiler: ": #stack 8.2.2"
80101 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
81102
103+ - env: BUILD=stack ARGS="--resolver lts-12"
104+ compiler: ": #stack 8.4.3"
105+ addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
106+
82107 # Nightly builds are allowed to fail
83108 - env: BUILD=stack ARGS="--resolver nightly"
84109 compiler: ": #stack nightly"
85110 addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
86111
87− # Build on OS X in addition to Linux
88− #- env: BUILD=stack ARGS=""
89− # compiler: ": #stack default osx"
90− # os: osx
112+ # Build on macOS in addition to Linux
113+ - env: BUILD=stack ARGS=""
114+ compiler: ": #stack default osx"
115+ os: osx
91116
92− # Travis includes an OS X which is incompatible with GHC 7.8.4
117+ # Travis includes an macOS which is incompatible with GHC 7.8.4
93118 #- env: BUILD=stack ARGS="--resolver lts-2"
94119 # compiler: ": #stack 7.8.4 osx"
95120 # os: osx
@@ -110,10 +135,14 @@ matrix:
110135 compiler: ": #stack 8.0.2 osx"
111136 os: osx
112137
113− - env: BUILD=stack ARGS="--resolver lts-10"
138+ - env: BUILD=stack ARGS="--resolver lts-11"
114139 compiler: ": #stack 8.2.2 osx"
115140 os: osx
116141
142+ - env: BUILD=stack ARGS="--resolver lts-12"
143+ compiler: ": #stack 8.4.3 osx"
144+ os: osx
145+
117146 - env: BUILD=stack ARGS="--resolver nightly"
118147 compiler: ": #stack nightly osx"
119148 os: osx
@@ -136,14 +165,14 @@ before_install:
136165- |
137166 if [ `uname` = "Darwin" ]
138167 then
139− travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
168+ 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
140169
141170 # brew no longer has fcgi
142171 # brew install fcgi
143172 grep -v wai-handler-fastcgi < stack.yaml > tmp
144173 mv tmp stack.yaml
145174 else
146− travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
175+ travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
147176 fi
148177
149178 # Use the more reliable S3 mirror of Hackage
@@ -151,10 +180,6 @@ before_install:
151180 echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
152181 echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
153182
154− if [ "$CABALVER" != "1.16" ]
155− then
156− echo 'jobs: $ncpus' >> $HOME/.cabal/config
157− fi
158183
159184install:
160185- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
@@ -166,20 +191,32 @@ install:
166191 # Avoid out of memory condition
167192 stack --no-terminal --install-ghc $ARGS build Cabal
168193
169− stack --no-terminal --install-ghc $ARGS test --only-dependencies
194+ # Add in extra-deps for older snapshots, as necessary
195+ #
196+ # This is disabled by default, as relying on the solver like this can
197+ # make builds unreliable. Instead, if you have this situation, it's
198+ # recommended that you maintain multiple stack-lts-X.yaml files.
199+
200+ #stack --no-terminal --install-ghc $ARGS test --bench --dry-run || ( \
201+ # stack --no-terminal $ARGS build cabal-install && \
202+ # stack --no-terminal $ARGS solver --update-config)
203+
204+ # Build the dependencies
205+ stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
170206 ;;
171207 cabal)
172208 cabal --version
173209 travis_retry cabal update
174210
175− # Get the list of packages from the stack.yaml file
211+ # Get the list of packages from the stack.yaml file. Note that
212+ # this will also implicitly run hpack as necessary to generate
213+ # the .cabal files needed by cabal-install.
176214 PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
177215
178216 # Due to dependency on wai-logger (which depends on some packages here),
179217 # we can't build just dependencies
180218 #
181− # cabal install --only-dependencies --enable-tests --force-reinstalls --ghc-options=-O0 --max-backjumps=-1 $CABALARGS $PACKAGES
182− cabal install hspec-discover
219+ # cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
183220 ;;
184221 esac
185222 set +ex
@@ -189,25 +226,29 @@ script:
189226 set -ex
190227 case "$BUILD" in
191228 stack)
192− stack --no-terminal $ARGS test --haddock --no-haddock-deps
229+ stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
193230 ;;
194231 cabal)
195− cabal install --enable-tests --force-reinstalls --ghc-options=-O0 --max-backjumps=-1 $CABALARGS $PACKAGES
232+ cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
196233
197234 ORIGDIR=$(pwd)
198235 for dir in $PACKAGES
199236 do
200237 cd $dir
201238 cabal check || [ "$CABALVER" == "1.16" ]
202− # Takes too long, see https://github.com/yesodweb/wai/issues/665
203− #cabal sdist
204− #PKGVER=$(cabal info . | awk '{print $2;exit}')
205− #SRC_TGZ=$PKGVER.tar.gz
206− #cd dist
207− #tar zxfv "$SRC_TGZ"
208− #cd "$PKGVER"
209− #cabal configure --enable-tests
210− #cabal build
239+ cabal sdist
240+ PKGVER=$(cabal info . | awk '{print $2;exit}')
241+ SRC_TGZ=$PKGVER.tar.gz
242+ cd dist
243+ tar zxfv "$SRC_TGZ"
244+ cd "$PKGVER"
245+ cabal configure --enable-tests --ghc-options -O0
246+ cabal build
247+ if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then
248+ cabal test
249+ else
250+ cabal test --show-details=streaming --log=/dev/stdout
251+ fi
211252 cd $ORIGDIR
212253 done
213254 ;;
appveyor.ymlnew file+37
@@ -0,0 +1,37 @@
1+build: off
2+
3+before_test:
4+# http://help.appveyor.com/discussions/problems/6312-curl-command-not-found
5+- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%
6+
7+- curl -sS -ostack.zip -L --insecure https://get.haskellstack.org/stable/windows-x86_64.zip
8+- 7z x stack.zip stack.exe
9+
10+clone_folder: "c:\\stack"
11+environment:
12+ global:
13+ STACK_ROOT: "c:\\sr"
14+
15+ # Override the temp directory to avoid sed escaping issues
16+ # See https://github.com/haskell/cabal/issues/5386
17+ TMP: "c:\\tmp"
18+
19+ matrix:
20+ - ARGS: ""
21+ #- ARGS: "--resolver lts-2"
22+ #- ARGS: "--resolver lts-3"
23+ - ARGS: "--resolver lts-6"
24+ #- ARGS: "--resolver lts-7"
25+ - ARGS: "--resolver lts-9"
26+ - ARGS: "--resolver lts-11"
27+ - ARGS: "--resolver lts-12"
28+ #- ARGS: "--resolver nightly"
29+
30+test_script:
31+
32+# Install toolchain, but do it silently due to lots of output
33+- stack %ARGS% setup > nul
34+
35+# The ugly echo "" hack is to avoid complaints about 0 being an invalid file
36+# descriptor
37+- echo "" | stack %ARGS% --no-terminal test