Skip to content

Commit c0dd2e6

Browse files
committed
Merge pull request purescript#1270 from hdgarrood/new-travis
Use the new Travis infrastructure
2 parents c25d2f8 + 078cbf2 commit c0dd2e6

File tree

6 files changed

+87
-50
lines changed

6 files changed

+87
-50
lines changed

.travis.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1+
sudo: false
12
env:
2-
- CABALVER=1.22 GHCVER=7.8.3 COVERAGE_SUITE=tests
3-
- CABALVER=1.22 GHCVER=7.8.3 COVERAGE_SUITE=psci-tests
4-
- CABALVER=1.22 GHCVER=7.6.3
5-
- CABALVER=1.22 GHCVER=7.10.1
3+
- GHCVER=7.8.3 COVERAGE_SUITE=tests
4+
- GHCVER=7.8.3 COVERAGE_SUITE=psci-tests
5+
- GHCVER=7.6.3
6+
- GHCVER=7.10.1
67
before_install:
7-
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
8-
- travis_retry sudo apt-get update
9-
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
10-
- export PATH="/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$PATH"
8+
- export PATH="/opt/ghc/$GHCVER/bin:$PATH"
9+
- export PATH="/opt/cabal/1.22/bin:$PATH"
10+
- export PATH="$HOME/.cabal/bin:$PATH"
11+
- export PATH="/opt/happy/1.19.5/bin:/$PATH"
12+
- export PATH="/opt/alex/3.1.4/bin:/$PATH"
1113
install:
1214
- cabal --version
1315
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
1416
- travis_retry cabal update
15-
- cabal install alex happy
16-
- cabal install --only-dependencies --enable-tests --enable-benchmarks
17+
- cabal sandbox init
18+
- cabal install --only-dependencies --enable-tests
19+
- cabal install hpc-coveralls
1720
script:
18-
- ./travis-script.sh
21+
- ./travis/configure.sh
22+
- cabal build
23+
- cabal test
24+
- ./travis/test-install.sh
1925
after_script:
20-
- ./travis-after-script.sh
26+
- ./travis/after.sh
2127
notifications:
2228
email: true
2329
before_deploy: "./bundle/build.sh linux64"
@@ -31,3 +37,18 @@ deploy:
3137
on:
3238
all_branches: true
3339
tags: true
40+
addons:
41+
apt:
42+
sources:
43+
- hvr-ghc
44+
packages:
45+
- cabal-install-1.22
46+
- ghc-7.6.3
47+
- ghc-7.8.3
48+
- ghc-7.10.1
49+
- happy-1.19.5
50+
- alex-3.1.4
51+
cache:
52+
directories:
53+
- .cabal-sandbox
54+
- ../install-test/.cabal-sandbox

travis-after-script.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

travis-script.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

travis/after.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
set -e
2+
3+
pushd core-tests/
4+
./test-everything.sh
5+
popd
6+
7+
if ! git describe --tags --exact-match >/dev/null 2>/dev/null && [ -n "$COVERAGE_SUITE" ]
8+
then
9+
case "$COVERAGE_SUITE" in
10+
"tests")
11+
./.cabal-sandbox/bin/hpc-coveralls \
12+
--exclude-dir=dist/build/autogen \
13+
--exclude-dir=tests \
14+
tests;;
15+
"psci-tests")
16+
./.cabal-sandbox/bin/hpc-coveralls \
17+
--exclude-dir=dist/build/autogen \
18+
--exclude-dir=src \
19+
--exclude-dir=psci/tests \
20+
psci-tests;;
21+
*)
22+
echo "unrecognised test suite $COVERAGE_SUITE"
23+
exit 1;;
24+
esac
25+
fi

travis/configure.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set -e
2+
3+
configure_flags="--enable-tests -v2"
4+
5+
if ! git describe --tags --exact-match >/dev/null 2>/dev/null
6+
then
7+
# Not a release build
8+
configure_flags="--disable-optimization $configure_flags"
9+
fi
10+
11+
if [ -n "$COVERAGE_SUITE" ]
12+
then
13+
configure_flags="--enable-coverage $configure_flags"
14+
fi
15+
16+
echo "> cabal configure $configure_flags"
17+
cabal configure $configure_flags

travis/test-install.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set -e
2+
3+
# Check that a source distribution can be successfully generated, and that
4+
# the generated source distribution can be installed
5+
cabal sdist
6+
if SRC_TGZ="$PWD/dist/$(cabal info . | awk '{print $2;exit}').tar.gz"
7+
then
8+
mkdir -p ../install-test
9+
cd ../install-test
10+
cabal sandbox init
11+
cabal install "$SRC_TGZ"
12+
fi

0 commit comments

Comments
 (0)