git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Reworking the Travis script
078cbf2Harry Garrood
.travis.yml+33−12
@@ -1,23 +1,29 @@
1+sudo: false
1env:
2env:
2− - CABALVER=1.22 GHCVER=7.8.3 COVERAGE_SUITE=tests
3+ - GHCVER=7.8.3 COVERAGE_SUITE=tests
3− - CABALVER=1.22 GHCVER=7.8.3 COVERAGE_SUITE=psci-tests
4+ - GHCVER=7.8.3 COVERAGE_SUITE=psci-tests
4− - CABALVER=1.22 GHCVER=7.6.3
5+ - GHCVER=7.6.3
5− - CABALVER=1.22 GHCVER=7.10.1
6+ - GHCVER=7.10.1
6before_install:
7before_install:
7− - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
8+ - export PATH="/opt/ghc/$GHCVER/bin:$PATH"
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"
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"
11install:
13install:
12 - cabal --version
14 - cabal --version
13 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
15 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
14 - travis_retry cabal update
16 - travis_retry cabal update
15− - cabal install alex happy
17+ - cabal sandbox init
16− - cabal install --only-dependencies --enable-tests --enable-benchmarks
18+ - cabal install --only-dependencies --enable-tests
19+ - cabal install hpc-coveralls
17script:
20script:
18− - ./travis-script.sh
21+ - ./travis/configure.sh
22+ - cabal build
23+ - cabal test
24+ - ./travis/test-install.sh
19after_script:
25after_script:
20− - ./travis-after-script.sh
26+ - ./travis/after.sh
21notifications:
27notifications:
22 email: true
28 email: true
23before_deploy: "./bundle/build.sh linux64"
29before_deploy: "./bundle/build.sh linux64"
@@ -31,3 +37,18 @@ deploy:
31 on:
37 on:
32 all_branches: true
38 all_branches: true
33 tags: true
39 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.shdeleted−21
@@ -1,21 +0,0 @@
1−set -e
2−
3−pushd core-tests/
4−
5−./test-everything.sh
6−
7−popd
8−
9−if [ -z $( git describe --tags --exact-match 2>/dev/null ) && -n "$COVERAGE_SUITE" ]
10−then
11− cabal install hpc-coveralls
12− case "$COVERAGE_SUITE" in
13− "tests")
14− hpc-coveralls --exclude-dir=dist/build/autogen --exclude-dir=tests tests;;
15− "psci-tests")
16− hpc-coveralls --exclude-dir=dist/build/autogen --exclude-dir=src --exclude-dir=psci/tests psci-tests;;
17− *)
18− echo "unrecognised test suite $COVERAGE_SUITE"
19− exit 1;;
20− esac
21−fi
travis-script.shdeleted−17
@@ -1,17 +0,0 @@
1−set -e
2−
3−if [ -z $( git describe --tags --exact-match 2>/dev/null ) && -n "$COVERAGE_SUITE" ]
4−then
5− cabal configure --enable-tests --enable-coverage -v2
6−else
7− cabal configure --enable-tests -v2
8−fi
9−
10−cabal build
11−cabal test
12−
13−# Check that a source distribution can be successfully generated, and that
14−# the generated source distribution can be installed
15−cabal sdist
16−SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
17− (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
travis/after.shnew file+25
@@ -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.shnew file+17
@@ -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.shnew file+12
@@ -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