Merge pull request #476 from begriffs/stack-ci

Switch to Stack on CircleCI
This commit is contained in:
Joe Nelson
2016-01-29 14:34:27 -08:00
5 changed files with 29 additions and 40 deletions
+18 -11
View File
@@ -1,16 +1,23 @@
machine: dependencies:
cache_directories:
- "~/.stack"
- ".stack-work"
pre: pre:
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 575159689BEFB442
- echo 'deb http://download.fpcomplete.com/ubuntu precise main'|sudo tee /etc/apt/sources.list.d/fpco.list
- sudo apt-get update && sudo apt-get install stack -y
- createuser --superuser --no-password postgrest_test - createuser --superuser --no-password postgrest_test
- createdb -O postgrest_test -U ubuntu postgrest_test - createdb -O postgrest_test -U ubuntu postgrest_test
ghc:
version: 7.10.1
dependencies:
override: override:
- cabal update - stack setup
- cabal sandbox init - stack install hlint packdeps cabal-install
- cabal install --upgrade-dependencies --constraint="template-haskell installed" --dependencies-only --enable-tests --reorder-goals - stack build --test --no-run-tests
- cabal configure --enable-tests -f ci
test: test:
post: override:
- cabal exec hlint -- -X QuasiQuotes src/**/*.hs test/**/*.hs - stack test
- cabal exec packdeps postgrest.cabal || true - git ls-files | grep '\.l\?hs$' | xargs stack exec -- hlint -X QuasiQuotes "$@"
- stack exec -- packdeps *.cabal || true
- stack exec -- cabal check
- stack haddock --no-haddock-deps
- stack sdist
+3 -23
View File
@@ -22,15 +22,10 @@ Flag CI
Default: False Default: False
executable postgrest executable postgrest
if flag(ci)
ghc-options: -Wall -W -Werror
else
ghc-options: -Wall -W -O2
main-is: PostgREST/Main.hs main-is: PostgREST/Main.hs
default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes, LambdaCase default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes, LambdaCase
default-language: Haskell2010 default-language: Haskell2010
build-depends: aeson >= 0.8 build-depends: aeson >= 0.8 && < 0.10
, base >= 4.8 && < 5 , base >= 4.8 && < 5
, bytestring , bytestring
, case-insensitive , case-insensitive
@@ -39,6 +34,7 @@ executable postgrest
, contravariant , contravariant
, errors , errors
, hasql >= 0.19.3.3 && < 0.20 , hasql >= 0.19.3.3 && < 0.20
, http-types
, interpolatedstring-perl6 , interpolatedstring-perl6
, jwt , jwt
, optparse-applicative >= 0.11 && < 0.13 , optparse-applicative >= 0.11 && < 0.13
@@ -51,7 +47,6 @@ executable postgrest
, string-conversions , string-conversions
, text , text
, time , time
, transformers
, unordered-containers , unordered-containers
, vector , vector
, wai >= 3.0.1 , wai >= 3.0.1
@@ -59,8 +54,7 @@ executable postgrest
, wai-extra , wai-extra
, wai-middleware-static >= 0.6.0 , wai-middleware-static >= 0.6.0
, warp >= 3.1.0 , warp >= 3.1.0
, HTTP, http-types , HTTP
, MissingH
, Ranged-sets , Ranged-sets
if !os(windows) if !os(windows)
build-depends: unix >= 2.7 && < 3 build-depends: unix >= 2.7 && < 3
@@ -80,11 +74,6 @@ executable postgrest
, PostgREST.Types , PostgREST.Types
library library
if flag(ci)
ghc-options: -Wall -W -Werror
else
ghc-options: -Wall -W -O2
default-language: Haskell2010 default-language: Haskell2010
default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes
build-depends: aeson build-depends: aeson
@@ -114,7 +103,6 @@ library
, wai-extra , wai-extra
, wai-middleware-static , wai-middleware-static
, HTTP , HTTP
, MissingH
, Ranged-sets , Ranged-sets
Other-Modules: Paths_postgrest Other-Modules: Paths_postgrest
@@ -136,10 +124,6 @@ Test-Suite spec
Default-Language: Haskell2010 Default-Language: Haskell2010
default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes, LambdaCase default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes, LambdaCase
Hs-Source-Dirs: test, src Hs-Source-Dirs: test, src
if flag(ci)
ghc-options: -Wall -W -Werror
else
ghc-options: -Wall -W -O2
Main-Is: Main.hs Main-Is: Main.hs
Other-Modules: Feature.AuthSpec Other-Modules: Feature.AuthSpec
, Feature.CorsSpec , Feature.CorsSpec
@@ -173,7 +157,6 @@ Test-Suite spec
, errors , errors
, hasql , hasql
, heredoc , heredoc
, hlint
, hspec == 2.2.* , hspec == 2.2.*
, hspec-wai , hspec-wai
, hspec-wai-json , hspec-wai-json
@@ -181,11 +164,9 @@ Test-Suite spec
, interpolatedstring-perl6 , interpolatedstring-perl6
, jwt , jwt
, optparse-applicative , optparse-applicative
, packdeps
, parsec , parsec
, process , process
, regex-tdfa , regex-tdfa
, resource-pool
, safe , safe
, scientific , scientific
, string-conversions , string-conversions
@@ -198,5 +179,4 @@ Test-Suite spec
, wai-extra , wai-extra
, wai-middleware-static , wai-middleware-static
, HTTP , HTTP
, MissingH
, Ranged-sets , Ranged-sets
+1 -1
View File
@@ -85,7 +85,7 @@ app dbStructure conf reqBody req =
then responseLBS status404 [] "" then responseLBS status404 [] ""
else responseLBS status200 [contentTypeH] (cs body) else responseLBS status200 [contentTypeH] (cs body)
else do else do
let frm = toInteger $ rangeOffset range let frm = rangeOffset range
to = frm + toInteger queryTotal - 1 to = frm + toInteger queryTotal - 1
contentRange = contentRangeH frm to (toInteger <$> tableTotal) contentRange = contentRangeH frm to (toInteger <$> tableTotal)
status = rangeStatus frm to (toInteger <$> tableTotal) status = rangeStatus frm to (toInteger <$> tableTotal)
+6 -4
View File
@@ -1,8 +1,10 @@
flags: {} resolver: lts-5.0
packages:
- '.'
extra-deps: extra-deps:
- hasql-0.19.3.3 - hasql-0.19.3.3
- Ranged-sets-0.3.0 - Ranged-sets-0.3.0
- packdeps-0.4.2.1 - packdeps-0.4.2.1
resolver: lts-5.0 ghc-options:
postgrest: -O2 -Werror -Wall -fwarn-monomorphism-restriction -fwarn-missing-exported-sigs -fwarn-identities
packages:
- '.'
+1 -1
View File
@@ -40,7 +40,7 @@ cfgLimitRows = cfg dbString . Just
withApp :: AppConfig -> DbStructure -> H.Connection withApp :: AppConfig -> DbStructure -> H.Connection
-> ActionWith Application -> IO () -> ActionWith Application -> IO ()
withApp config dbStructure c perform = do withApp config dbStructure c perform =
perform $ defaultMiddle $ \req resp -> do perform $ defaultMiddle $ \req resp -> do
time <- getPOSIXTime time <- getPOSIXTime
body <- strictRequestBody req body <- strictRequestBody req