@@ -1,48 +1,41 @@
1# explicitly request container-based infrastructure
3# explicitly request container-based infrastructure
6− - env: GHCVER=7.8.4 STACK_YAML=stack-7.8.yaml
8+ - env: CABALVER=1.18 GHCVER=7.8.4 HAPPYVER=1.19.4
7− addons:
9+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.4], sources: [hvr-ghc]}}
8− apt:
10+ - env: CABALVER=1.22 GHCVER=7.10.1 HAPPYVER=1.19.5
9− sources:
11+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,happy-1.19.5],sources: [hvr-ghc]}}
13− - env: GHCVER=7.10.2 STACK_YAML=stack.yaml
20− - env: GHCVER=head STACK_YAML=stack-head.yaml
12+ - env: CABALVER=head GHCVER=head HAPPYVER=head
21− addons:
13+ addons: {apt: {packages: [cabal-install-head,ghc-head,happy-head], sources: [hvr-ghc]}}
28− - env: GHCVER=7.8.4 STACK_YAML=stack-7.8.yaml
29− - env: GHCVER=head STACK_YAML=stack-head.yaml
31−cache:
15+ allow_failures:
32− directories:
16+ - env: CABALVER=1.18 GHCVER=7.8.4 HAPPYVER=1.19.4
33− - $HOME/.stack/
17+ - env: CABALVER=head GHCVER=head HAPPYVER=head
35before_install:
19before_install:
37− - export PATH=/opt/ghc/$GHCVER/bin:$PATH
20+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH:/opt/happy/$HAPPYVER/bin
39− - mkdir -p ~/.local/bin
40− - export PATH=~/.local/bin:$PATH
41− - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
44− - stack --no-terminal --skip-ghc-check setup
23+ - cabal --version
45− - stack --no-terminal --skip-ghc-check test --only-snapshot
24+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
25+ - travis_retry cabal update
26+ - cabal install --only-dependencies --enable-tests --enable-benchmarks
28+# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail.
48− - stack --no-terminal --skip-ghc-check test --pedantic
30+ - if [ -f configure.ac ]; then autoreconf -i; fi
31+ - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
32+ - cabal build # this builds all libraries and executables (including tests/benchmarks)
35+ - cabal sdist # tests that a source-distribution can be generated
37+# Check that the resulting source distribution can be built & installed.
38+# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
39+# `cabal install --force-reinstalls dist/*-*.tar.gz`
40+ - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
41+ (cd dist && cabal install --force-reinstalls "$SRC_TGZ")