13
13
branches :
14
14
only :
15
15
- master
16
- - release-0.12
17
16
18
17
cache :
19
18
directories :
@@ -35,19 +34,19 @@ matrix:
35
34
include :
36
35
- compiler : " ghc-8.4.3"
37
36
# env: TEST=--disable-tests BENCH=--disable-benchmarks
38
- addons : {apt: {packages: [ghc-ppa-tools,ghc-8.4.3], sources: [hvr-ghc]}}
37
+ addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.2, ghc-8.4.3], sources: [hvr-ghc]}}
39
38
- compiler : " ghc-8.2.2"
40
39
# env: TEST=--disable-tests BENCH=--disable-benchmarks
41
- addons : {apt: {packages: [ghc-ppa-tools,ghc-8.2.2], sources: [hvr-ghc]}}
40
+ addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.2, ghc-8.2.2], sources: [hvr-ghc]}}
42
41
- compiler : " ghc-8.0.2"
43
42
# env: TEST=--disable-tests BENCH=--disable-benchmarks
44
- addons : {apt: {packages: [ghc-ppa-tools,ghc-8.0.2], sources: [hvr-ghc]}}
43
+ addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.2, ghc-8.0.2], sources: [hvr-ghc]}}
45
44
- compiler : " ghc-7.10.3"
46
45
# env: TEST=--disable-tests BENCH=--disable-benchmarks
47
- addons : {apt: {packages: [ghc-ppa-tools,ghc-7.10.3], sources: [hvr-ghc]}}
46
+ addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.2, ghc-7.10.3], sources: [hvr-ghc]}}
48
47
- compiler : " ghc-7.8.4"
49
48
# env: TEST=--disable-tests BENCH=--disable-benchmarks
50
- addons : {apt: {packages: [ghc-ppa-tools,ghc-7.8.4], sources: [hvr-ghc]}}
49
+ addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.2, ghc-7.8.4], sources: [hvr-ghc]}}
51
50
52
51
before_install :
53
52
- HC=${CC}
@@ -59,34 +58,27 @@ before_install:
59
58
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
60
59
- echo $HCNUMVER
61
60
62
- # Let's download "better" cabal
63
- - " curl -L http://oleg.fi/cabal-grayjay-buildable-fix.xz | xz -d > $HOME/.local/bin/cabal"
64
- - |
65
- if [ "$(cd $HOME/.local/bin && sha256sum cabal)" != "e281e9466b8eef30ac0d1371e8ea83c9d2e856bda4714a728ac474138b09b20f cabal" ]; then
66
- rm -f $HOME/.local/bin/cabal;
67
- sha256sum $HOME/.local/bin/cabal;
68
- false;
69
- else
70
- chmod a+x $HOME/.local/bin/cabal;
71
- fi
72
-
73
61
install :
74
62
- cabal --version
75
63
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
76
64
- BENCH=${BENCH---enable-benchmarks}
77
65
- TEST=${TEST---enable-tests}
78
66
- HADDOCK=${HADDOCK-true}
79
- - INSTALLED=${INSTALLED-true}
67
+ - UNCONSTRAINED=${UNCONSTRAINED-true}
68
+ - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
80
69
- GHCHEAD=${GHCHEAD-false}
81
70
- travis_retry cabal update -v
82
71
- " sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
83
72
- rm -fv cabal.project cabal.project.local
84
73
- " if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
85
74
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
86
- - " printf 'packages: \" servant\" \" servant-client\" \" servant-client-core\" \" servant-docs\" \" servant-foreign\" \" servant-server\" \" doc/tutorial\" \" doc/cookbook/basic-auth\" \" doc/cookbook/db-postgres-pool\" \" doc/cookbook/db-sqlite-simple\" \" doc/cookbook/https\" \" doc/cookbook/pagination\" \" doc/cookbook/structuring-apis\" \" doc/cookbook/using-custom-monad\"\\ n' > cabal.project"
75
+ - " printf 'packages: \" servant\" \" servant-client\" \" servant-client-core\" \" servant-docs\" \" servant-foreign\" \" servant-server\" \" doc/tutorial\" \" doc/cookbook/basic-auth\" \" doc/cookbook/db-postgres-pool\" \" doc/cookbook/db-sqlite-simple\" \" doc/cookbook/file-upload \" \" doc/cookbook/ https\" \" doc/cookbook/jwt-and-basic-auth \" \" doc/cookbook/pagination\" \" doc/cookbook/structuring-apis\" \" doc/cookbook/using-custom-monad\"\\ n' > cabal.project"
87
76
- " echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
88
- - " echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, http-media:base' >> cabal.project"
89
- - cat cabal.project
77
+ - " echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, servant-pagination:servant,servant-pagination:servant-server' >> cabal.project"
78
+ - touch cabal.project.local
79
+ - " if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
80
+ - cat cabal.project || true
81
+ - cat cabal.project.local || true
90
82
- if [ -f "servant/configure.ac" ]; then
91
83
(cd "servant" && autoreconf -i);
92
84
fi
@@ -117,9 +109,15 @@ install:
117
109
- if [ -f "doc/cookbook/db-sqlite-simple/configure.ac" ]; then
118
110
(cd "doc/cookbook/db-sqlite-simple" && autoreconf -i);
119
111
fi
112
+ - if [ -f "doc/cookbook/file-upload/configure.ac" ]; then
113
+ (cd "doc/cookbook/file-upload" && autoreconf -i);
114
+ fi
120
115
- if [ -f "doc/cookbook/https/configure.ac" ]; then
121
116
(cd "doc/cookbook/https" && autoreconf -i);
122
117
fi
118
+ - if [ -f "doc/cookbook/jwt-and-basic-auth/configure.ac" ]; then
119
+ (cd "doc/cookbook/jwt-and-basic-auth" && autoreconf -i);
120
+ fi
123
121
- if [ -f "doc/cookbook/pagination/configure.ac" ]; then
124
122
(cd "doc/cookbook/pagination" && autoreconf -i);
125
123
fi
@@ -130,7 +128,7 @@ install:
130
128
(cd "doc/cookbook/using-custom-monad" && autoreconf -i);
131
129
fi
132
130
- rm -f cabal.project.freeze
133
- - rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/https"/dist "doc/cookbook/pagination"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist
131
+ - rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/file-upload"/dist "doc/cookbook/ https"/dist "doc/cookbook/jwt-and-basic-auth "/dist "doc/cookbook/pagination"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist
134
132
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
135
133
136
134
# Here starts the actual work to be performed for the package under test;
@@ -148,22 +146,26 @@ script:
148
146
- (cd "doc/cookbook/basic-auth" && cabal sdist)
149
147
- (cd "doc/cookbook/db-postgres-pool" && cabal sdist)
150
148
- (cd "doc/cookbook/db-sqlite-simple" && cabal sdist)
149
+ - (cd "doc/cookbook/file-upload" && cabal sdist)
151
150
- (cd "doc/cookbook/https" && cabal sdist)
151
+ - (cd "doc/cookbook/jwt-and-basic-auth" && cabal sdist)
152
152
- (cd "doc/cookbook/pagination" && cabal sdist)
153
153
- (cd "doc/cookbook/structuring-apis" && cabal sdist)
154
154
- (cd "doc/cookbook/using-custom-monad" && cabal sdist)
155
155
- echo -en 'travis_fold:end:sdist\\r'
156
156
- echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
157
- - mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-client-core"/dist/servant-client-core-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz "doc/cookbook/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/pagination"/dist/cookbook-pagination-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz ${DISTDIR}/
157
+ - mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-client-core"/dist/servant-client-core-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz "doc/cookbook/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/file-upload"/dist/cookbook-file-upload-*.tar.gz "doc/cookbook/ https"/dist/cookbook-https-*.tar.gz "doc/cookbook/jwt-and-basic-auth"/dist/cookbook-jwt-and-basic-auth -*.tar.gz "doc/cookbook/pagination"/dist/cookbook-pagination-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz ${DISTDIR}/
158
158
- cd ${DISTDIR} || false
159
159
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
160
- - " printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-https-*/*.cabal cookbook-pagination-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal\\ n' > cabal.project"
160
+ - " printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-file-upload-*/*.cabal cookbook- https-*/*.cabal cookbook-jwt-and-basic-auth -*/*.cabal cookbook-pagination-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal\\ n' > cabal.project"
161
161
- " echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
162
- - " echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, http-media:base' >> cabal.project"
163
- - cat cabal.project
162
+ - " echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, servant-pagination:servant,servant-pagination:servant-server' >> cabal.project"
163
+ - touch cabal.project.local
164
+ - " if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
165
+ - cat cabal.project || true
166
+ - cat cabal.project.local || true
164
167
- echo -en 'travis_fold:end:unpack\\r'
165
168
166
-
167
169
- echo Building with tests and benchmarks... && echo -en 'travis_fold:start:build-everything\\r'
168
170
# build & run tests, build benchmarks
169
171
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
@@ -176,5 +178,10 @@ script:
176
178
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
177
179
178
180
- echo -en 'travis_fold:end:haddock\\r'
181
+ - echo Building without installed constraints for packages in global-db... && echo -en 'travis_fold:start:build-installed\\r'
182
+ # Build without installed constraints for packages in global-db
183
+ - if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
184
+
185
+ - echo -en 'travis_fold:end:build-installed\\r'
179
186
# REGENDATA ["--config=cabal.make-travis-yml","--output=.travis.yml","cabal.project"]
180
187
# EOF
0 commit comments