From 62fa0bec91841083768f36f53a40fe8831dbcabd Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Tue, 16 Apr 2019 14:00:05 +0300 Subject: [PATCH] Add http-media constraint-sets --- .travis.yml | 274 +++++++++++++++++++++++++++-------------------- cabal.haskell-ci | 8 +- cabal.project | 2 + 3 files changed, 168 insertions(+), 116 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec0a0e7d..7e86e067 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,24 +4,21 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.2.1 +# version: 0.3.20190413 # language: c dist: xenial - git: - submodules: false # whether to recursively clone submodules - + # whether to recursively clone submodules + submodules: false branches: only: - master - release-0.16 - cache: directories: - $HOME/.cabal/packages - $HOME/.cabal/store - before_cache: - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log # remove files that are regenerated by 'cabal update' @@ -30,78 +27,113 @@ before_cache: - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx - - rm -rfv $CABALHOME/packages/head.hackage - matrix: include: - - compiler: "ghc-8.6.4" - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.4], sources: [hvr-ghc]}} - - compiler: "ghc-8.4.4" - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}} - - compiler: "ghc-8.2.2" - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}} - - compiler: "ghc-8.0.2" - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}} - + - compiler: ghc-8.6.4 + addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.4","cabal-install-2.4"]}} + - compiler: ghc-8.4.4 + addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}} + - compiler: ghc-8.2.2 + addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}} + - compiler: ghc-8.0.2 + addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}} before_install: - - HC=/opt/ghc/bin/${CC} - - HCPKG=${HC/ghc/ghc-pkg} + - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//') + - HCPKG="$HC-pkg" - unset CC - CABAL=/opt/ghc/bin/cabal - CABALHOME=$HOME/.cabal - export PATH="$CABALHOME/bin:$PATH" - - ROOTDIR=$(pwd) + - TOP=$(pwd) - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') )) - echo $HCNUMVER - + - CABAL="$CABAL -vnormal+nowrap+markoutput" + - set -o pipefail + - | + echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk + echo 'BEGIN { state = "output"; }' >> .colorful.awk + echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk + echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk + echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk + echo ' if (state == "cabal") {' >> .colorful.awk + echo ' print blue($0)' >> .colorful.awk + echo ' } else {' >> .colorful.awk + echo ' print $0' >> .colorful.awk + echo ' }' >> .colorful.awk + echo '}' >> .colorful.awk + - cat .colorful.awk + - | + color_cabal_output () { + awk -f $TOP/.colorful.awk + } + - echo text | color_cabal_output install: - ${CABAL} --version - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" - TEST=--enable-tests - BENCH=--enable-benchmarks - GHCHEAD=${GHCHEAD-false} - - travis_retry ${CABAL} update -v - - sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config - - rm -fv cabal.project cabal.project.local - - "sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' $CABALHOME/config" - - grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$' - - rm -f cabal.project + - rm -f $CABALHOME/config + - | + echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config + echo "remote-build-reporting: anonymous" >> $CABALHOME/config + echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config + echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config + echo "world-file: $CABALHOME/world" >> $CABALHOME/config + echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config + echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config + echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config + echo "store-dir: $CABALHOME/store" >> $CABALHOME/config + echo "install-dirs user" >> $CABALHOME/config + echo " prefix: $CABALHOME" >> $CABALHOME/config + echo "repository hackage.haskell.org" >> $CABALHOME/config + echo " url: http://hackage.haskell.org/" >> $CABALHOME/config + - | + echo "program-default-options" >> $CABALHOME/config + echo " ghc-options: -j2" >> $CABALHOME/config + - cat $CABALHOME/config + - rm -fv cabal.project cabal.project.local cabal.project.freeze + - travis_retry ${CABAL} v2-update -v + # Generate cabal.project + - rm -rf cabal.project cabal.project.local cabal.project.freeze - touch cabal.project - - "printf 'packages: \"servant\"\\n' >> cabal.project" - - "printf 'packages: \"servant-client\"\\n' >> cabal.project" - - "printf 'packages: \"servant-client-core\"\\n' >> cabal.project" - - "printf 'packages: \"servant-http-streams\"\\n' >> cabal.project" - - "printf 'packages: \"servant-docs\"\\n' >> cabal.project" - - "printf 'packages: \"servant-foreign\"\\n' >> cabal.project" - - "printf 'packages: \"servant-server\"\\n' >> cabal.project" - - "printf 'packages: \"doc/tutorial\"\\n' >> cabal.project" - - "printf 'packages: \"servant-machines\"\\n' >> cabal.project" - - "printf 'packages: \"servant-conduit\"\\n' >> cabal.project" - - "printf 'packages: \"servant-pipes\"\\n' >> cabal.project" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/basic-auth\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/curl-mock\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/basic-streaming\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/db-postgres-pool\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/db-sqlite-simple\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/file-upload\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/generic\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/https\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/pagination\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/testing\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/structuring-apis\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/using-custom-monad\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/using-free-client\"\\n' >> cabal.project ; fi" - - "echo 'constraints: foundation >=0.0.14' >> cabal.project" - - "echo 'constraints: memory <0.14.12 || >0.14.12' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:servant' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:servant-client' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:servant-server' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:hspec' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:http-client' >> cabal.project" - - "echo 'optimization: False' >> cabal.project " - - "printf 'write-ghc-environment-files: always\\n' >> cabal.project" - - touch cabal.project.local + - | + echo 'packages: "servant"' >> cabal.project + echo 'packages: "servant-client"' >> cabal.project + echo 'packages: "servant-client-core"' >> cabal.project + echo 'packages: "servant-http-streams"' >> cabal.project + echo 'packages: "servant-docs"' >> cabal.project + echo 'packages: "servant-foreign"' >> cabal.project + echo 'packages: "servant-server"' >> cabal.project + echo 'packages: "doc/tutorial"' >> cabal.project + echo 'packages: "servant-machines"' >> cabal.project + echo 'packages: "servant-conduit"' >> cabal.project + echo 'packages: "servant-pipes"' >> cabal.project + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/basic-auth"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/curl-mock"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/basic-streaming"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/db-postgres-pool"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/db-sqlite-simple"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/file-upload"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/generic"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/https"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/pagination"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/testing"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/structuring-apis"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/using-custom-monad"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/using-free-client"' >> cabal.project ; fi + - | + echo "constraints: foundation >=0.0.14" >> cabal.project + echo "constraints: memory <0.14.12 || >0.14.12" >> cabal.project + echo "allow-newer: servant-quickcheck:servant" >> cabal.project + echo "allow-newer: servant-quickcheck:servant-client" >> cabal.project + echo "allow-newer: servant-quickcheck:servant-server" >> cabal.project + echo "allow-newer: servant-quickcheck:hspec" >> cabal.project + echo "allow-newer: servant-quickcheck:http-client" >> cabal.project + echo "allow-newer: http-media" >> cabal.project + echo "optimization: False" >> cabal.project + echo "write-ghc-environment-files: always" >> cabal.project - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - cat cabal.project || true - cat cabal.project.local || true @@ -129,72 +161,84 @@ install: - if [ -f "doc/cookbook/structuring-apis/configure.ac" ]; then (cd "doc/cookbook/structuring-apis" && autoreconf -i); fi - if [ -f "doc/cookbook/using-custom-monad/configure.ac" ]; then (cd "doc/cookbook/using-custom-monad" && autoreconf -i); fi - if [ -f "doc/cookbook/using-free-client/configure.ac" ]; then (cd "doc/cookbook/using-free-client" && autoreconf -i); fi - - rm -f cabal.project.freeze - - rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-http-streams"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "servant-machines"/dist "servant-conduit"/dist "servant-pipes"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/curl-mock"/dist "doc/cookbook/basic-streaming"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/file-upload"/dist "doc/cookbook/generic"/dist "doc/cookbook/https"/dist "doc/cookbook/pagination"/dist "doc/cookbook/testing"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist "doc/cookbook/using-free-client"/dist - - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) - -# Here starts the actual work to be performed for the package under test; -# any command which exits with a non-zero exit code causes the build to fail. + - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output + - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" + - rm cabal.project.freeze script: - # test that source-distributions can be generated - - echo Packaging... && echo -en 'travis_fold:start:sdist\\r' - - ${CABAL} new-sdist all + - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) + # Packaging... + - echo 'Packaging...' && echo -en 'travis_fold:start:sdist\\r' + - ${CABAL} v2-sdist all | color_cabal_output - echo -en 'travis_fold:end:sdist\\r' - - echo Unpacking... && echo -en 'travis_fold:start:unpack\\r' + # Unpacking... + - echo 'Unpacking...' && echo -en 'travis_fold:start:unpack\\r' - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/ - cd ${DISTDIR} || false - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; - - rm -f cabal.project + # Generate cabal.project + - rm -rf cabal.project cabal.project.local cabal.project.freeze - touch cabal.project - - "printf 'packages: \"servant-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-client-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-client-core-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-http-streams-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-docs-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-foreign-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-server-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"tutorial-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-machines-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-conduit-*/*.cabal\"\\n' >> cabal.project" - - "printf 'packages: \"servant-pipes-*/*.cabal\"\\n' >> cabal.project" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-basic-auth-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-curl-mock-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-basic-streaming-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-db-postgres-pool-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-db-sqlite-simple-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-file-upload-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-generic-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-https-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-pagination-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-testing-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-structuring-apis-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-using-custom-monad-*/*.cabal\"\\n' >> cabal.project ; fi" - - "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-using-free-client-*/*.cabal\"\\n' >> cabal.project ; fi" - - "echo 'constraints: foundation >=0.0.14' >> cabal.project" - - "echo 'constraints: memory <0.14.12 || >0.14.12' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:servant' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:servant-client' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:servant-server' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:hspec' >> cabal.project" - - "echo 'allow-newer: servant-quickcheck:http-client' >> cabal.project" - - "echo 'optimization: False' >> cabal.project " - - "printf 'write-ghc-environment-files: always\\n' >> cabal.project" - - touch cabal.project.local + - | + echo 'packages: "servant-*/*.cabal"' >> cabal.project + echo 'packages: "servant-client-*/*.cabal"' >> cabal.project + echo 'packages: "servant-client-core-*/*.cabal"' >> cabal.project + echo 'packages: "servant-http-streams-*/*.cabal"' >> cabal.project + echo 'packages: "servant-docs-*/*.cabal"' >> cabal.project + echo 'packages: "servant-foreign-*/*.cabal"' >> cabal.project + echo 'packages: "servant-server-*/*.cabal"' >> cabal.project + echo 'packages: "tutorial-*/*.cabal"' >> cabal.project + echo 'packages: "servant-machines-*/*.cabal"' >> cabal.project + echo 'packages: "servant-conduit-*/*.cabal"' >> cabal.project + echo 'packages: "servant-pipes-*/*.cabal"' >> cabal.project + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-basic-auth-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-curl-mock-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-basic-streaming-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-db-postgres-pool-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-db-sqlite-simple-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-file-upload-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-generic-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-https-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-pagination-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-testing-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-structuring-apis-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-using-custom-monad-*/*.cabal"' >> cabal.project ; fi + if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-using-free-client-*/*.cabal"' >> cabal.project ; fi + - | + echo "constraints: foundation >=0.0.14" >> cabal.project + echo "constraints: memory <0.14.12 || >0.14.12" >> cabal.project + echo "allow-newer: servant-quickcheck:servant" >> cabal.project + echo "allow-newer: servant-quickcheck:servant-client" >> cabal.project + echo "allow-newer: servant-quickcheck:servant-server" >> cabal.project + echo "allow-newer: servant-quickcheck:hspec" >> cabal.project + echo "allow-newer: servant-quickcheck:http-client" >> cabal.project + echo "allow-newer: http-media" >> cabal.project + echo "optimization: False" >> cabal.project + echo "write-ghc-environment-files: always" >> cabal.project - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - cat cabal.project || true - cat cabal.project.local || true - echo -en 'travis_fold:end:unpack\\r' - - - echo Building with tests and benchmarks... && echo -en 'travis_fold:start:build-everything\\r' + # Building with tests and benchmarks... + - echo 'Building with tests and benchmarks...' && echo -en 'travis_fold:start:build-everything\\r' # build & run tests, build benchmarks - - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all + - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output - echo -en 'travis_fold:end:build-everything\\r' - - if [ "x$TEST" = "x--enable-tests" ]; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all; fi - - - echo Haddock... && echo -en 'travis_fold:start:haddock\\r' - # haddock - - ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all - + # Testing... + - ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output + # haddock... + - echo 'haddock...' && echo -en 'travis_fold:start:haddock\\r' + - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output - echo -en 'travis_fold:end:haddock\\r' + # Constraint sets + - rm -rf cabal.project.local + # Constraint set http-media-0.8 + - echo 'Constraint set http-media-0.8' && echo -en 'travis_fold:start:constraint-sets-http-media-0.8\\r' + - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --constraint='http-media ==0.8.*' all | color_cabal_output + - echo -en 'travis_fold:end:constraint-sets-http-media-0.8\\r' + # Constraint set http-media-0.7 + - echo 'Constraint set http-media-0.7' && echo -en 'travis_fold:start:constraint-sets-http-media-0.7\\r' + - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --constraint='http-media ==0.7.*' all | color_cabal_output + - echo -en 'travis_fold:end:constraint-sets-http-media-0.7\\r' + # REGENDATA ["--config=cabal.haskell-ci","--output=.travis.yml","cabal.project"] # EOF diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 1db5d1cc..8b84b642 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,5 +1,5 @@ folds: all-but-test -branches: master +branches: master release-0.16 jobs-selection: any -- We have inplace packages (servant-js) so we skip installing dependencies in a separate step @@ -14,3 +14,9 @@ cabal-check: False -- ghc-options: -j2 jobs: :2 + +constraint-set http-media-0.8 + constraints: http-media ==0.8.* + +constraint-set http-media-0.7 + constraints: http-media ==0.7.* diff --git a/cabal.project b/cabal.project index 7c88a106..171185ca 100644 --- a/cabal.project +++ b/cabal.project @@ -51,3 +51,5 @@ allow-newer: servant-quickcheck:servant, servant-quickcheck:servant-client, servant-quickcheck:servant-server, servant-quickcheck:hspec, servant-quickcheck:http-client + +allow-newer: http-media