Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 37 additions & 23 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20240708
# version: 0.19.20250722
#
# REGENDATA ("0.19.20240708",["github","cabal.project"])
# REGENDATA ("0.19.20250722",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -23,7 +23,7 @@ on:
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes:
60
container:
Expand All @@ -38,19 +38,24 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.10.1
- compiler: ghc-9.12.2
compilerKind: ghc
compilerVersion: 9.10.1
compilerVersion: 9.12.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
- compiler: ghc-9.10.2
compilerKind: ghc
compilerVersion: 9.8.2
compilerVersion: 9.10.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.6
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.6.6
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.7
compilerKind: ghc
compilerVersion: 9.6.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
Expand Down Expand Up @@ -85,15 +90,29 @@ jobs:
allow-failure: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -104,21 +123,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -193,7 +203,11 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_postgresql_simple}" >> cabal.project
echo "package postgresql-simple" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package postgresql-simple" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package postgresql-simple" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(postgresql-simple)$/; }' >> cabal.project.local
Expand Down Expand Up @@ -234,8 +248,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v4
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
17 changes: 8 additions & 9 deletions postgresql-simple.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cabal-version: 1.12
name: postgresql-simple
version: 0.7.0.0
x-revision: 3
version: 0.7.0.1
synopsis: Mid-Level PostgreSQL client library
description:
Mid-Level PostgreSQL client library, forked from mysql-simple.
Expand Down Expand Up @@ -30,9 +29,10 @@ tested-with:
|| ==9.0.2
|| ==9.2.8
|| ==9.4.8
|| ==9.6.6
|| ==9.8.2
|| ==9.10.1
|| ==9.6.7
|| ==9.8.4
|| ==9.10.2
|| ==9.12.2

library
default-language: Haskell2010
Expand Down Expand Up @@ -78,10 +78,10 @@ library

-- GHC bundled libs
build-depends:
base >=4.12.0.0 && <4.21
base >=4.12.0.0 && <4.22
, bytestring >=0.10.8.2 && <0.13
, containers >=0.6.0.1 && <0.8
, template-haskell >=2.14.0.0 && <2.23
, template-haskell >=2.14.0.0 && <2.24
, text >=1.2.3.0 && <1.3 || >=2.0 && <2.2
, time-compat >=1.9.5 && <1.12
, transformers >=0.5.6.2 && <0.7
Expand Down Expand Up @@ -118,7 +118,7 @@ test-suite inspection
main-is: Inspection.hs
build-depends:
base
, inspection-testing >=0.4.1.1 && <0.6
, inspection-testing >=0.4.1.1 && <0.7
, postgresql-libpq
, postgresql-simple
, tasty
Expand Down Expand Up @@ -156,7 +156,6 @@ test-suite test
, containers
, cryptohash-md5 >=0.11.100.1 && <0.12
, filepath
, HUnit
, postgresql-simple
, tasty
, tasty-golden
Expand Down
1 change: 1 addition & 0 deletions src/Database/PostgreSQL/Simple/Copy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ doCopy funcName conn template q = do
PQ.BadResponse -> throwResultError funcName result status
PQ.NonfatalError -> throwResultError funcName result status
PQ.FatalError -> throwResultError funcName result status
_ -> throwResultError funcName result status -- TODO

data CopyOutResult
= CopyOutRow !B.ByteString -- ^ Data representing either exactly
Expand Down
2 changes: 2 additions & 0 deletions src/Database/PostgreSQL/Simple/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ exec conn sql =
PQ.BadResponse -> getResult h mres'
PQ.NonfatalError -> getResult h mres'
PQ.FatalError -> getResult h mres'
_ -> error "incomplete match"
#endif

-- | A version of 'execute' that does not perform query substitution.
Expand Down Expand Up @@ -431,6 +432,7 @@ finishExecute _conn q result = do
PQ.BadResponse -> throwResultError "execute" result status
PQ.NonfatalError -> throwResultError "execute" result status
PQ.FatalError -> throwResultError "execute" result status
_ -> throwResultError "execute: TODO" result status
where
mkInteger str = B8.foldl' delta 0 str
where
Expand Down
1 change: 1 addition & 0 deletions src/Database/PostgreSQL/Simple/Internal/PQResultUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ finishQueryWith' q result k = do
PQ.BadResponse -> throwResultError "query" result status
PQ.NonfatalError -> throwResultError "query" result status
PQ.FatalError -> throwResultError "query" result status
_ -> throwResultError "query: TODO" result status
where
queryErr msg = throwIO $ QueryError msg q

Expand Down
Loading