git.iko.soy/typeable/postgresql-simple
on master help sign in
Update CI configs
145dc89Oleg Grenrus
.travis.yml+14−2
@@ -40,29 +40,41 @@ before_cache:
40 - rm -rfv $CABALHOME/packages/head.hackage
40 - rm -rfv $CABALHOME/packages/head.hackage
41jobs:
41jobs:
42 include:
42 include:
43− - compiler: ghc-8.8.1
43+ - compiler: ghc-8.10.2
44+ addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.10.2","cabal-install-3.4"]}}
45+ env: DATABASE_CONNSTRING=travis
46+ os: linux
47+ - compiler: ghc-8.8.4
44− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.1","cabal-install-3.4"]}}
48+ addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.4","cabal-install-3.4"]}}
49+ env: DATABASE_CONNSTRING=travis
45 os: linux
50 os: linux
46 - compiler: ghc-8.6.5
51 - compiler: ghc-8.6.5
47 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.4"]}}
52 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.4"]}}
53+ env: DATABASE_CONNSTRING=travis
48 os: linux
54 os: linux
49 - compiler: ghc-8.4.4
55 - compiler: ghc-8.4.4
50 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.4"]}}
56 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.4"]}}
57+ env: DATABASE_CONNSTRING=travis
51 os: linux
58 os: linux
52 - compiler: ghc-8.2.2
59 - compiler: ghc-8.2.2
53 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.4"]}}
60 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.4"]}}
61+ env: DATABASE_CONNSTRING=travis
54 os: linux
62 os: linux
55 - compiler: ghc-8.0.2
63 - compiler: ghc-8.0.2
56 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.4"]}}
64 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.4"]}}
65+ env: DATABASE_CONNSTRING=travis
57 os: linux
66 os: linux
58 - compiler: ghc-7.10.3
67 - compiler: ghc-7.10.3
59 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.10.3","cabal-install-3.4"]}}
68 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.10.3","cabal-install-3.4"]}}
69+ env: DATABASE_CONNSTRING=travis
60 os: linux
70 os: linux
61 - compiler: ghc-7.8.4
71 - compiler: ghc-7.8.4
62 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.8.4","cabal-install-3.4"]}}
72 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.8.4","cabal-install-3.4"]}}
73+ env: DATABASE_CONNSTRING=travis
63 os: linux
74 os: linux
64 - compiler: ghc-7.6.3
75 - compiler: ghc-7.6.3
65 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.6.3","cabal-install-3.4"]}}
76 addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.6.3","cabal-install-3.4"]}}
77+ env: DATABASE_CONNSTRING=travis
66 os: linux
78 os: linux
67before_install:
79before_install:
68 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
80 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
appveyor.ymlnew file+80
@@ -0,0 +1,80 @@
1+clone_folder: "c:\\WORK"
2+
3+branches:
4+ only:
5+ - master
6+
7+services:
8+ - postgresql96
9+
10+environment:
11+ global:
12+ CABOPTS: "--store-dir=C:\\SR --http-transport=plain-http"
13+ PGUSER: postgres
14+ PGPASSWORD: Password12!
15+ PGPORT: "5432"
16+ DATABASE_CONNSTRING: appveyor
17+ matrix:
18+ # 64 bit builds
19+ - GHCVER: "8.8.1"
20+ CHOCOPTS:
21+ - GHCVER: "8.6.5"
22+ CHOCOPTS:
23+ - GHCVER: "8.4.4"
24+ CHOCOPTS:
25+ - GHCVER: "8.2.2"
26+ CHOCOPTS:
27+ - GHCVER: "8.0.2"
28+ CHOCOPTS:
29+ - GHCVER: "7.10.3.2"
30+ CHOCOPTS:
31+
32+ # Fails to link
33+ #
34+ # - GHCVER: "7.8.4.1"
35+ # CHOCOPTS:
36+
37+ # 32 bit builds
38+
39+ # Linker errors...
40+
41+ # - GHCVER: "8.6.5"
42+ # CHOCOPTS: --forcex86
43+ # - GHCVER: "8.4.4"
44+ # CHOCOPTS: --forcex86
45+ # - GHCVER: "8.2.2"
46+ # CHOCOPTS: --forcex86
47+
48+ # older segfault?
49+
50+cache:
51+- "C:\\SR"
52+
53+install:
54+ - "choco install -y ghc --version %GHCVER% %CHOCOPTS%"
55+ - "choco install -y cabal %CHOCOPTS%"
56+ - "refreshenv"
57+ - "set PATH=C:\\ghc\\ghc-%GHCVER%:C:\\msys64\\mingw64\\bin;C:\\msys64\\usr\\bin;%PATH%"
58+ - "cabal --version"
59+ - "ghc --version"
60+
61+ - set PATH=C:\Progra~1\PostgreSQL\9.6\bin\;%PATH%
62+
63+build: off
64+
65+test_script:
66+ - "cabal %CABOPTS% update -v"
67+ - createdb TestDb
68+ - IF EXIST configure.ac bash -c "autoreconf -i"
69+ - "move cabal.project.local.win cabal.project.local"
70+
71+ - "cabal %CABOPTS% v2-build -j1 libs test"
72+ # - "cabal %CABOPTS% v2-test -j1 all"
73+ - "cabal %CABOPTS% v2-run test"
74+ # - "cabal %CABOPTS% v2-run inspection" # only GHC-8.0 (or GHC-8.2+)
75+
76+ # Build from sdist
77+ - "rmdir /Q /S dist-newstyle"
78+ - "cabal v2-sdist"
79+ - "sh -c 'echo packages: dist-newstyle/sdist/*.tar.gz > cabal.project'"
80+ - "cabal v2-build -j1 postgresql-simple" # TODO: unfortunately the package name have to be here
cabal.haskell-ci+10
@@ -3,3 +3,13 @@ postgresql: True
3
3
4-- services aren't supported on Travis on macOS
4-- services aren't supported on Travis on macOS
5-- osx: 8.4.4
5-- osx: 8.4.4
6+
7+env: 7.6.3:DATABASE_CONNSTRING=travis
8+env: 7.8.4:DATABASE_CONNSTRING=travis
9+env: 7.10.3:DATABASE_CONNSTRING=travis
10+env: 8.0.2:DATABASE_CONNSTRING=travis
11+env: 8.2.2:DATABASE_CONNSTRING=travis
12+env: 8.4.4:DATABASE_CONNSTRING=travis
13+env: 8.6.5:DATABASE_CONNSTRING=travis
14+env: 8.8.4:DATABASE_CONNSTRING=travis
15+env: 8.10.2:DATABASE_CONNSTRING=travis
cabal.project.local.winnew file+4
@@ -0,0 +1,4 @@
1+constraints: these -assoc
2+
3+package postgresql-libpq
4+ flags: -use-pkg-config
postgresql-simple.cabal+10−9
@@ -18,8 +18,8 @@ copyright:
18category: Database
18category: Database
19build-type: Simple
19build-type: Simple
20extra-source-files:
20extra-source-files:
21− CONTRIBUTORS
22 CHANGES.md
21 CHANGES.md
22+ CONTRIBUTORS
23 test/results/malformed-input.expected
23 test/results/malformed-input.expected
24 test/results/unique-constraint-violation.expected
24 test/results/unique-constraint-violation.expected
25
25
@@ -31,7 +31,8 @@ tested-with:
31 || ==8.2.2
31 || ==8.2.2
32 || ==8.4.4
32 || ==8.4.4
33 || ==8.6.5
33 || ==8.6.5
34− || ==8.8.1
34+ || ==8.8.4
35+ || ==8.10.2
35
36
36library
37library
37 default-language: Haskell2010
38 default-language: Haskell2010
@@ -41,11 +42,13 @@ library
41 Database.PostgreSQL.Simple.Arrays
42 Database.PostgreSQL.Simple.Arrays
42 Database.PostgreSQL.Simple.Copy
43 Database.PostgreSQL.Simple.Copy
43 Database.PostgreSQL.Simple.Cursor
44 Database.PostgreSQL.Simple.Cursor
45+ Database.PostgreSQL.Simple.Errors
44 Database.PostgreSQL.Simple.FromField
46 Database.PostgreSQL.Simple.FromField
45 Database.PostgreSQL.Simple.FromRow
47 Database.PostgreSQL.Simple.FromRow
46− Database.PostgreSQL.Simple.LargeObjects
47 Database.PostgreSQL.Simple.HStore
48 Database.PostgreSQL.Simple.HStore
48 Database.PostgreSQL.Simple.HStore.Internal
49 Database.PostgreSQL.Simple.HStore.Internal
50+ Database.PostgreSQL.Simple.Internal
51+ Database.PostgreSQL.Simple.LargeObjects
49 Database.PostgreSQL.Simple.Notification
52 Database.PostgreSQL.Simple.Notification
50 Database.PostgreSQL.Simple.Ok
53 Database.PostgreSQL.Simple.Ok
51 Database.PostgreSQL.Simple.Range
54 Database.PostgreSQL.Simple.Range
@@ -59,12 +62,9 @@ library
59 Database.PostgreSQL.Simple.TypeInfo.Macro
62 Database.PostgreSQL.Simple.TypeInfo.Macro
60 Database.PostgreSQL.Simple.TypeInfo.Static
63 Database.PostgreSQL.Simple.TypeInfo.Static
61 Database.PostgreSQL.Simple.Types
64 Database.PostgreSQL.Simple.Types
62− Database.PostgreSQL.Simple.Errors
63 Database.PostgreSQL.Simple.Vector
65 Database.PostgreSQL.Simple.Vector
64 Database.PostgreSQL.Simple.Vector.Unboxed
66 Database.PostgreSQL.Simple.Vector.Unboxed
65
67
66− Database.PostgreSQL.Simple.Internal
67−
68 -- Other-modules:
68 -- Other-modules:
69 other-modules:
69 other-modules:
70 Database.PostgreSQL.Simple.Compat
70 Database.PostgreSQL.Simple.Compat
@@ -107,11 +107,11 @@ library
107 build-depends: ghc-prim
107 build-depends: ghc-prim
108
108
109 default-extensions:
109 default-extensions:
110+ BangPatterns
110 DoAndIfThenElse
111 DoAndIfThenElse
111 OverloadedStrings
112 OverloadedStrings
112− BangPatterns
113− ViewPatterns
114 TypeOperators
113 TypeOperators
114+ ViewPatterns
115
115
116 ghc-options: -Wall -fno-warn-name-shadowing
116 ghc-options: -Wall -fno-warn-name-shadowing
117
117
@@ -151,13 +151,14 @@ test-suite test
151 Serializable
151 Serializable
152 Time
152 Time
153
153
154+ ghc-options: -threaded
154 ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-unused-do-bind
155 ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-unused-do-bind
155 default-extensions:
156 default-extensions:
156 NamedFieldPuns
157 NamedFieldPuns
157 OverloadedStrings
158 OverloadedStrings
159+ PatternGuards
158 Rank2Types
160 Rank2Types
159 RecordWildCards
161 RecordWildCards
160− PatternGuards
161 ScopedTypeVariables
162 ScopedTypeVariables
162
163
163 build-depends:
164 build-depends:
test/Main.hs+15−7
@@ -25,6 +25,7 @@ import GHC.Generics (Generic)
25import Data.Aeson
25import Data.Aeson
26import Data.ByteString (ByteString)
26import Data.ByteString (ByteString)
27import qualified Data.ByteString as B
27import qualified Data.ByteString as B
28+import qualified Data.ByteString.Char8 as BS8
28import qualified Data.ByteString.Lazy.Char8 as BL
29import qualified Data.ByteString.Lazy.Char8 as BL
29import Data.CaseInsensitive (CI)
30import Data.CaseInsensitive (CI)
30import qualified Data.CaseInsensitive as CI
31import qualified Data.CaseInsensitive as CI
@@ -36,6 +37,7 @@ import qualified Data.Vector as V
36import System.FilePath
37import System.FilePath
37import System.Timeout(timeout)
38import System.Timeout(timeout)
38import Data.Time(getCurrentTime, diffUTCTime)
39import Data.Time(getCurrentTime, diffUTCTime)
40+import System.Environment (getEnvironment)
39
41
40import Test.Tasty
42import Test.Tasty
41import Test.Tasty.Golden
43import Test.Tasty.Golden
@@ -546,18 +548,24 @@ isFormatError i FormatError{..}
546--
548--
547-- Note that some tests, such as Notify, use multiple connections, and assume
549-- Note that some tests, such as Notify, use multiple connections, and assume
548-- that 'testConnect' connects to the same database every time it is called.
550-- that 'testConnect' connects to the same database every time it is called.
549−testConnect :: IO Connection
550−testConnect = connectPostgreSQL ""
551−
552−withTestEnv :: (TestEnv -> IO a) -> IO a
551+withTestEnv :: ByteString -> (TestEnv -> IO a) -> IO a
553−withTestEnv cb =
552+withTestEnv connstr cb =
554 withConn $ \conn ->
553 withConn $ \conn ->
555 cb TestEnv
554 cb TestEnv
556 { conn = conn
555 { conn = conn
557 , withConn = withConn
556 , withConn = withConn
558 }
557 }
559 where
558 where
560− withConn = bracket testConnect close
559+ withConn = bracket (connectPostgreSQL connstr) close
561
560
562main :: IO ()
561main :: IO ()
562+main = do
563+ env <- getEnvironment
564+ case lookup "DATABASE_CONNSTRING" env of
565+ Nothing -> putStrLn "Set DATABASE_CONNSTRING environment variable"
563−main = withTestEnv $ defaultMain . tests
566+ Just s -> withTestEnv (BS8.pack (special s)) (defaultMain . tests)
567+ where
568+ -- https://www.appveyor.com/docs/services-databases/
569+ special "appveyor" = "dbname='TestDb' user='postgres' password='Password12!'"
570+ special "travis" = ""
571+ special s = s