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,10 +10,15 @@ 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
16
20
- $HOME/.cabal/store
21
+ - $HOME/.local/bin
17
22
18
23
before_cache :
19
24
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
@@ -27,19 +32,22 @@ before_cache:
27
32
matrix :
28
33
include :
29
34
- compiler : " ghc-7.8.4"
30
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
35
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
31
36
addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
32
37
- compiler : " ghc-7.10.3"
33
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
38
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
34
39
addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
35
40
- compiler : " ghc-8.0.2"
36
- # env: TEST=--disable-tests BENCH=--disable-benchmarks
41
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
37
42
addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
43
+ - compiler : " ghc-8.2.1"
44
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
45
+ addons : {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
38
46
39
47
before_install :
40
48
- HC=${CC}
41
49
- unset CC
42
- - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
50
+ - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/.local/bin:$ PATH
43
51
- PKGNAME='servant-swagger'
44
52
45
53
install :
@@ -49,23 +57,18 @@ install:
49
57
- TEST=${TEST---enable-tests}
50
58
- travis_retry cabal update -v
51
59
- 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
-
60
+ - sh install-hspec-discover.sh # TEMP: we should use build-tools-depends
58
61
- rm -fv cabal.project.local
59
62
- " echo 'packages: .' > cabal.project"
60
63
- 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
64
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
65
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
63
66
64
67
# Here starts the actual work to be performed for the package under test;
65
68
# any command which exits with a non-zero exit code causes the build to fail.
66
69
script :
67
70
- if [ -f configure.ac ]; then autoreconf -i; fi
68
- - rm -rf dist/ .ghc.environment.*
71
+ - rm -rf .ghc.environment.* dist/
69
72
- cabal sdist # test that a source-distribution can be generated
70
73
- cd dist/
71
74
- SRCTAR=(${PKGNAME}-*.tar.gz)
@@ -77,27 +80,15 @@ script:
77
80
- " echo 'packages: .' > cabal.project"
78
81
# this builds all libraries and executables (without tests/benchmarks)
79
82
- 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
-
83
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
91
84
# this builds all libraries and executables (including tests/benchmarks)
92
85
# - rm -rf ./dist-newstyle
93
- - cabal new-build -w ${HC} ${TEST} ${BENCH}
94
86
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
87
+ # build & run tests, build benchmarks
88
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
89
+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
90
+
91
+ # haddock
92
+ - cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all
102
93
103
94
# EOF
0 commit comments