1
1
# This Travis job script has been generated by a script via
2
2
#
3
- # make_travis_yml_2.hs 'servant-swagger.cabal'
3
+ # make_travis_yml_2.hs '--branch' 'master' ' servant-swagger.cabal'
4
4
#
5
5
# For more information, see https://github.com/hvr/multi-ghc-travis
6
6
#
@@ -10,6 +10,10 @@ sudo: false
10
10
git :
11
11
submodules : false # whether to recursively clone submodules
12
12
13
+ branches :
14
+ only :
15
+ - master
16
+
13
17
cache :
14
18
directories :
15
19
- $HOME/.cabal/packages
@@ -27,14 +31,17 @@ before_cache:
27
31
matrix :
28
32
include :
29
33
- compiler : " ghc-7.8.4"
30
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
34
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
31
35
addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
32
36
- compiler : " ghc-7.10.3"
33
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
37
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
34
38
addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
35
39
- compiler : " ghc-8.0.2"
36
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
40
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
37
41
addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
42
+ - compiler : " ghc-8.2.1"
43
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
44
+ addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
38
45
39
46
before_install :
40
47
- HC=${CC}
@@ -49,23 +56,17 @@ install:
49
56
- TEST=${TEST---enable-tests}
50
57
- travis_retry cabal update -v
51
58
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
52
- # Install hspec-discover manually, before hackage accepts build-tool-depends
53
- - mkdir -p $HOME/.local/bin
54
- - export PATH=$HOME/.local/bin/:$PATH
55
- - cabal get hspec-discover
56
- - " cd hspec-discover-*; cabal new-build hspec-discover:exe:hspec-discover; cp $(find dist-newstyle -type f -name hspec-discover) $HOME/.local/bin; cd .."
57
-
58
59
- rm -fv cabal.project.local
59
60
- " echo 'packages: .' > cabal.project"
60
61
- rm -f cabal.project.freeze
61
- - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2
62
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2
62
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
63
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
63
64
64
65
# Here starts the actual work to be performed for the package under test;
65
66
# any command which exits with a non-zero exit code causes the build to fail.
66
67
script :
67
68
- if [ -f configure.ac ]; then autoreconf -i; fi
68
- - rm -rf dist/ .ghc.environment.*
69
+ - rm -rf .ghc.environment.* dist/
69
70
- cabal sdist # test that a source-distribution can be generated
70
71
- cd dist/
71
72
- SRCTAR=(${PKGNAME}-*.tar.gz)
@@ -77,27 +78,12 @@ script:
77
78
- " echo 'packages: .' > cabal.project"
78
79
# this builds all libraries and executables (without tests/benchmarks)
79
80
- rm -f cabal.project.freeze
80
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks
81
-
82
- # Build with various constraints
83
- - if [ $HC = "ghc-8.0.2" ]; then UNLESSGHC802=true; fi
84
- - $UNLESSGHC802 cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.5.*"
85
- - $UNLESSGHC802 cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.6.*"
86
- - $UNLESSGHC802 cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.7.*"
87
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.8.*"
88
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.9.*"
89
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.10.*"
90
-
81
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
91
82
# this builds all libraries and executables (including tests/benchmarks)
92
83
# - rm -rf ./dist-newstyle
93
- - cabal new-build -w ${HC} ${TEST} ${BENCH}
94
84
95
- # there's no 'cabal new-test' yet, so let's emulate for now
96
- - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) )
97
- - if [ "$TEST" != "--enable-tests" ]; then TESTS=(); fi
98
- - shopt -s globstar;
99
- RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
100
- if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
101
- else echo "= $T FAILED ="; RC=false; fi; done; $RC
85
+ # build & run tests
86
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
87
+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
102
88
103
89
# EOF
0 commit comments