Skip to content

Commit 14c3d74

Browse files
authored
Merge pull request #6 from phadej/http-media-0.7
Allow http-media-0.7
2 parents 1297427 + 8944eb7 commit 14c3d74

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

.travis.yml

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# make_travis_yml_2.hs 'servant-multipart.cabal'
3+
# make_travis_yml_2.hs '--branch' 'master' 'servant-multipart.cabal'
44
#
55
# For more information, see https://github.com/hvr/multi-ghc-travis
66
#
@@ -10,6 +10,10 @@ sudo: false
1010
git:
1111
submodules: false # whether to recursively clone submodules
1212

13+
branches:
14+
only:
15+
- master
16+
1317
cache:
1418
directories:
1519
- $HOME/.cabal/packages
@@ -35,35 +39,37 @@ matrix:
3539
- compiler: "ghc-8.0.2"
3640
# env: TEST=--disable-tests BENCH=--disable-benchmarks
3741
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]}}
3845

3946
before_install:
4047
- HC=${CC}
48+
- HCPKG=${HC/ghc/ghc-pkg}
4149
- unset CC
4250
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
4351
- PKGNAME='servant-multipart'
44-
- ROOTDIR=$(pwd)
4552

4653
install:
4754
- cabal --version
4855
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
4956
- BENCH=${BENCH---enable-benchmarks}
5057
- TEST=${TEST---enable-tests}
58+
- HADDOCK=${HADDOCK-true}
59+
- INSTALLED=${INSTALLED-true}
5160
- travis_retry cabal update -v
5261
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
5362
- 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"
5864
- 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
6167

6268
# Here starts the actual work to be performed for the package under test;
6369
# any command which exits with a non-zero exit code causes the build to fail.
6470
script:
6571
- if [ -f configure.ac ]; then autoreconf -i; fi
66-
- rm -rf dist/
72+
- rm -rf .ghc.environment.* dist/
6773
- cabal sdist # test that a source-distribution can be generated
6874
- cd dist/
6975
- SRCTAR=(${PKGNAME}-*.tar.gz)
@@ -72,21 +78,24 @@ script:
7278
- cd "$SRC_BASENAME/"
7379
## from here on, CWD is inside the extracted source-tarball
7480
- rm -fv cabal.project.local
75-
- "echo 'packages: . servant/servant/ servant/servant-server/ ' > cabal.project"
76-
- mv $ROOTDIR/servant .
81+
- "echo 'packages: .' > cabal.project"
7782
# this builds all libraries and executables (without tests/benchmarks)
7883
- 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
8085
# this builds all libraries and executables (including tests/benchmarks)
8186
# - rm -rf ./dist-newstyle
82-
- cabal new-build -w ${HC} ${TEST} ${BENCH}
8387

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
9199

100+
# REGENDATA ["--branch","master","servant-multipart.cabal"]
92101
# EOF

servant-multipart.cabal

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: servant-multipart
22
version: 0.10.0.1
3+
x-revision: 1
34
synopsis: multipart/form-data (e.g file upload) support for servant
45
description: Please see README.md
56
homepage: https://github.com/haskell-servant/servant-multipart#readme
@@ -14,7 +15,8 @@ cabal-version: >=1.10
1415
tested-with:
1516
GHC==7.8.4,
1617
GHC==7.10.3,
17-
GHC==8.0.2
18+
GHC==8.0.2,
19+
GHC==8.2.1
1820

1921
library
2022
hs-source-dirs: src
@@ -23,7 +25,7 @@ library
2325
base >= 4.7 && < 5,
2426
bytestring >= 0.10 && <0.11,
2527
directory,
26-
http-media >= 0.6 && <0.7,
28+
http-media >= 0.6 && <0.8,
2729
resourcet >=1.1 && <1.2,
2830
servant >=0.10 && <0.12,
2931
servant-server >=0.10 && <0.12,

0 commit comments

Comments
 (0)