1
1
# This Travis job script has been generated by a script via
2
2
#
3
- # make_travis_yml_2.hs 'servant-multipart.cabal'
3
+ # make_travis_yml_2.hs '--branch' 'master' ' servant-multipart.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
@@ -35,35 +39,37 @@ matrix:
35
39
- compiler : " ghc-8.0.2"
36
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}
48
+ - HCPKG=${HC/ghc/ghc-pkg}
41
49
- unset CC
42
50
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
43
51
- PKGNAME='servant-multipart'
44
- - ROOTDIR=$(pwd)
45
52
46
53
install :
47
54
- cabal --version
48
55
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
49
56
- BENCH=${BENCH---enable-benchmarks}
50
57
- TEST=${TEST---enable-tests}
58
+ - HADDOCK=${HADDOCK-true}
59
+ - INSTALLED=${INSTALLED-true}
51
60
- travis_retry cabal update -v
52
61
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
53
62
- rm -fv cabal.project.local
54
- # Fetch not-released servant
55
- - git clone https://github.com/haskell-servant/servant.git
56
- - cd servant; git checkout 736918a694dd7247fbd3f21a9bc138f6dcc5b3dd; cd ..
57
- - " echo 'packages: . servant/servant/ servant/servant-server/ ' > cabal.project"
63
+ - " echo 'packages: .' > cabal.project"
58
64
- rm -f cabal.project.freeze
59
- - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2
60
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2
65
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
66
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
61
67
62
68
# Here starts the actual work to be performed for the package under test;
63
69
# any command which exits with a non-zero exit code causes the build to fail.
64
70
script :
65
71
- if [ -f configure.ac ]; then autoreconf -i; fi
66
- - rm -rf dist/
72
+ - rm -rf .ghc.environment.* dist/
67
73
- cabal sdist # test that a source-distribution can be generated
68
74
- cd dist/
69
75
- SRCTAR=(${PKGNAME}-*.tar.gz)
@@ -72,21 +78,24 @@ script:
72
78
- cd "$SRC_BASENAME/"
73
79
# # from here on, CWD is inside the extracted source-tarball
74
80
- rm -fv cabal.project.local
75
- - " echo 'packages: . servant/servant/ servant/servant-server/ ' > cabal.project"
76
- - mv $ROOTDIR/servant .
81
+ - " echo 'packages: .' > cabal.project"
77
82
# this builds all libraries and executables (without tests/benchmarks)
78
83
- rm -f cabal.project.freeze
79
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks
84
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
80
85
# this builds all libraries and executables (including tests/benchmarks)
81
86
# - rm -rf ./dist-newstyle
82
- - cabal new-build -w ${HC} ${TEST} ${BENCH}
83
87
84
- # there's no 'cabal new-test' yet, so let's emulate for now
85
- - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) )
86
- - if [ "$TEST" != "--enable-tests" ]; then TESTS=(); fi
87
- - shopt -s globstar;
88
- RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
89
- if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
90
- else echo "= $T FAILED ="; RC=false; fi; done; $RC
88
+ # Build with installed constraints for packages in global-db
89
+ - if $INSTALLED; then
90
+ ${HCPKG} list --global --simple-output --names-only | sed -r 's/([a-zA-Z0-9-]+*) */--constraint=\1 installed;/g' | sed 's/;$/;all/' | xargs -d ';' cabal new-build -w ${HC} --disable-tests --disable-benchmarks;
91
+ else echo "Not building with installed constraints"; fi
92
+
93
+ # build & run tests, build benchmarks
94
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
95
+
96
+ # haddock
97
+ - rm -rf ./dist-newstyle
98
+ - if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
91
99
100
+ # REGENDATA ["--branch","master","servant-multipart.cabal"]
92
101
# EOF
0 commit comments