Skip to content

Commit ae731b3

Browse files
committed
1 parent beb0556 commit ae731b3

2 files changed

Lines changed: 44 additions & 36 deletions

File tree

.travis.yml

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1+
language: c
12
sudo: false
2-
env:
3-
- GHCVER=7.8.4 COVERAGE_SUITE=tests
4-
- GHCVER=7.8.4 COVERAGE_SUITE=psci-tests
5-
- GHCVER=7.6.3
6-
- GHCVER=7.10.1
7-
- GHCVER=7.8.4 STACKAGE=lts-2.22
8-
# 7.10.2 Pending https://github.com/travis-ci/apt-package-whitelist/pull/686
9-
- GHCVER=7.10.1 STACKAGE=lts-3.1
10-
- GHCVER=7.10.1 STACKAGE=nightly-2015-08-12
3+
matrix:
4+
include:
5+
- env: GHCVER=7.8.4 COVERAGE_SUITE=tests
6+
compiler: ": #GHC 7.8.4 - tests"
7+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.8.4,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
8+
- env: GHCVER=7.8.4 COVERAGE_SUITE=psci-tests
9+
compiler: ": #GHC 7.8.4 - psci-tests"
10+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.8.4,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
11+
- env: GHCVER=7.8.4 STACKAGE=lts-22
12+
compiler: ": #GHC 7.8.4 - lts-2.22"
13+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.8.4,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
14+
- env: GHCVER=7.6.3
15+
compiler: ": #GHC 7.6.3"
16+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.6.3,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
17+
- env: GHCVER=7.10.1
18+
compiler: ": #GHC 7.10.1"
19+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
20+
# 7.10.2 Pending https://github.com/travis-ci/apt-package-whitelist/pull/686
21+
- env: GHCVER=7.10.1 STACKAGE=lts=3.1 RUNSDISTTESTS=YES
22+
compiler: ": #GHC 7.10.1 lts-3.1"
23+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
24+
- env: GHCVER=7.10.1 STACKAGE=nightly-2015-08-12
25+
compiler: ": #GHC 7.10.1 nightly-2015-08-12"
26+
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1,happy-1.19.5,alex-3.1.4], sources: [hvr-ghc]}}
1127
before_install:
28+
- unset CC
1229
- export PATH="/opt/ghc/$GHCVER/bin:$PATH"
1330
- export PATH="/opt/cabal/1.22/bin:$PATH"
1431
- export PATH="$HOME/.cabal/bin:$PATH"
@@ -23,13 +40,20 @@ install:
2340
# cabal and ghc tries to use them all. Which is bad idea on a shared box.
2441
# See also: https://ghc.haskell.org/trac/ghc/ticket/9221
2542
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
26-
- mkdir -p sandboxes/$GHCVER/${STACKAGE:-none}
27-
- cabal sandbox init --sandbox sandboxes/$GHCVER/${STACKAGE:-none}
28-
# Download stackage cabal.config
29-
# Not sure whether filtering out purescript is necessary
43+
# Cache sandboxes in ~/cabal-sandboxes
44+
# Move right sandbox to .cabal-sandbox if exists
45+
- if [ -d ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} ]; then
46+
mv ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none} .cabal-sandbox;
47+
fi
48+
- mkdir -p .cabal-sandbox
49+
- cabal sandbox init --sandbox .cabal-sandbox
50+
# Download stackage cabal.config, not sure whether filtering is necessary
3051
- if [ -n "$STACKAGE" ]; then curl http://www.stackage.org/$STACKAGE/cabal.config | grep -v purescript > cabal.config; fi
3152
- cabal install --only-dependencies --enable-tests
3253
- cabal install hpc-coveralls
54+
# Snapshot state of the sandbox now, so we don't need to make new one for test install
55+
- rm -rf ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none}
56+
- cp -r .cabal-sandbox ~/cabal-sandboxes/$GHCVER-${STACKAGE:-none}
3357
script:
3458
- ./travis/configure.sh
3559
- cabal build
@@ -50,18 +74,6 @@ deploy:
5074
on:
5175
all_branches: true
5276
tags: true
53-
addons:
54-
apt:
55-
sources:
56-
- hvr-ghc
57-
packages:
58-
- cabal-install-1.22
59-
- ghc-7.6.3
60-
- ghc-7.8.4
61-
- ghc-7.10.1
62-
- happy-1.19.5
63-
- alex-3.1.4
6477
cache:
6578
directories:
66-
- sandboxes/
67-
- ../install-test/sandboxes/
79+
- ~/cabal-sandboxes

travis/test-install.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@ set -e
33
# Check that a source distribution can be successfully generated, and that
44
# the generated source distribution can be installed and tested
55
cabal sdist
6-
PKGNAME=$(cabal info . | awk '{print $2;exit}')
7-
if SRC_TGZ="$PWD/dist/$PKGNAME.tar.gz"
6+
if SRC_TGZ="$PWD/dist/$(cabal info . | awk '{print $2;exit}').tar.gz"
87
then
9-
mkdir -p ../install-test
10-
cd ../install-test
11-
mkdir -p sandboxes/$GHCVER/${STACKAGE:-none}
12-
cabal sandbox init --sandbox sandboxes/$GHCVER/${STACKAGE:-none}
13-
14-
if [ `echo "$STACKAGE" | sed 's/\..*$//'` = "lts-3" ]; then
15-
tar -xzf i--strip-components=1 $PKGNAME.tar.gz
16-
cabal install
8+
if [ "$RUNSDISTTESTS" = "YES" ]; then
9+
mkdir test-install
10+
cd test-install
11+
tar --strip-components=1 -xzf $SRC_TGZ
12+
cabal install --enable-tests --force-reinstalls
1713
cabal test
1814
else
1915
cabal install "$SRC_TGZ"

0 commit comments

Comments
 (0)