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
106 changes: 73 additions & 33 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,92 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'hedis.cabal'
# haskell-ci 'github' '--config=cabal.haskell-ci' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.18.1
# version: 0.19.20260331
#
# REGENDATA ("0.18.1",["github","hedis.cabal"])
# REGENDATA ("0.19.20260331",["github","--config=cabal.haskell-ci","cabal.project"])
#
name: Haskell-CI
on:
- push
- pull_request
push:
branches:
- master
pull_request:
branches:
- master
merge_group:
branches:
- master
workflow_dispatch:
{}
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.4.8
- compiler: ghc-9.14.1
compilerKind: ghc
compilerVersion: 9.4.8
compilerVersion: 9.14.1
setup-method: ghcup
allow-failure: true
- compiler: ghc-9.6.7
allow-failure: false
- compiler: ghc-9.12.4
compilerKind: ghc
compilerVersion: 9.6.7
compilerVersion: 9.12.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.3
compilerKind: ghc
compilerVersion: 9.10.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.2
- compiler: ghc-9.6.7
compilerKind: ghc
compilerVersion: 9.10.2
compilerVersion: 9.6.7
setup-method: ghcup
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.20.0/x86_64-linux-ghcup-0.1.20.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.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.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.10.2.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 @@ -69,21 +97,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.10.2.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 @@ -123,6 +142,11 @@ jobs:
- name: update cabal index
run: |
$CABAL v2-update -v
- name: cache (tools)
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2ae1f11d
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
Expand All @@ -132,8 +156,18 @@ jobs:
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: install doctest
run: |
$CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.24'
doctest --version
- name: save cache (tools)
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2ae1f11d
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
path: source
- name: initial cabal.project for sdist
Expand All @@ -158,18 +192,23 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_hedis}" >> cabal.project
echo "package hedis" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
echo "package hedis" >> cabal.project
echo " ghc-options: -Werror=unused-packages" >> cabal.project
echo "package hedis" >> cabal.project
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: *:base
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(hedis)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(hedis)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -184,9 +223,10 @@ jobs:
- name: build
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: tests
- name: doctest
run: |
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
cd ${PKGDIR_hedis} || false
doctest -XHaskell2010 src
- name: cabal check
run: |
cd ${PKGDIR_hedis} || false
Expand All @@ -199,8 +239,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
36 changes: 0 additions & 36 deletions .github/workflows/test.yml

This file was deleted.

11 changes: 11 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
branches: master

doctest: True
doctest-version: ^>=0.24

tests: True

benchmarks: True

-- Some tests don't pass.
run-tests: False
6 changes: 2 additions & 4 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
packages:
./

source-repository-package
type: git
location: https://github.com/scrive/pool
tag: eeabc8746d4fa68063551d81bf9fa330c3396845
-- GHC 9.14
allow-newer: *:base
19 changes: 6 additions & 13 deletions hedis.cabal
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cabal-version: 3.0
build-type: Simple
name: hedis
version: 7.1.0
synopsis:
Expand Down Expand Up @@ -36,24 +38,17 @@ Description:
.
For detailed documentation, see the "Database.Redis" module.
.
license: BSD3
license: BSD-3-Clause
license-file: LICENSE
author: Falko Peters <falko.peters@gmail.com>
maintainer: Kostiantyn Rybnikov <k-bx@k-bx.com>
copyright: Copyright (c) 2011 Falko Peters
category: Database
build-type: Simple
cabal-version: >=1.10
homepage: https://github.com/informatikr/hedis
bug-reports: https://github.com/informatikr/hedis/issues
extra-source-files: CHANGELOG

tested-with:
GHC ==9.12.2
|| ==9.10.2
|| ==9.8.4
|| ==9.6.7
|| ==9.4.8
tested-with: GHC == { 9.6.7, 9.8.4, 9.10.3, 9.12.4, 9.14.1 }

source-repository head
type: git
Expand All @@ -67,9 +62,7 @@ flag dev
library
default-language: Haskell2010
hs-source-dirs: src
ghc-options: -Wall -fwarn-tabs
if impl(ghc >= 8.6.0)
ghc-options: -Wno-warnings-deprecations
ghc-options: -Wall -Wcompat
if impl(ghc >= 9.8)
ghc-options: -Wno-x-partial
if flag(dev)
Expand All @@ -96,7 +89,7 @@ library
, Database.Redis.URL
build-depends: scanner >= 0.2,
async >= 2.1,
base >= 4.8 && < 5,
base >= 4.18 && < 5,
bytestring >= 0.9,
bytestring-lexing >= 0.5,
exceptions,
Expand Down
7 changes: 3 additions & 4 deletions src/Database/Redis/Cluster.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import Database.Redis.Cluster.HashSlot(HashSlot, keyToSlot)
import qualified Database.Redis.ConnectionContext as CC
import qualified Data.HashMap.Strict as HM
import qualified Data.IntMap.Strict as IntMap
import Data.Typeable
import qualified Scanner
import System.IO.Unsafe(unsafeInterleaveIO)

Expand Down Expand Up @@ -93,13 +92,13 @@ data Shard = Shard MasterNode [SlaveNode] deriving (Show, Eq, Ord)

newtype ShardMap = ShardMap (IntMap.IntMap Shard) deriving (Show)

newtype MissingNodeException = MissingNodeException [B.ByteString] deriving (Show, Typeable)
newtype MissingNodeException = MissingNodeException [B.ByteString] deriving (Show)
instance Exception MissingNodeException

newtype UnsupportedClusterCommandException = UnsupportedClusterCommandException [B.ByteString] deriving (Show, Typeable)
newtype UnsupportedClusterCommandException = UnsupportedClusterCommandException [B.ByteString] deriving (Show)
instance Exception UnsupportedClusterCommandException

newtype CrossSlotException = CrossSlotException [[B.ByteString]] deriving (Show, Typeable)
newtype CrossSlotException = CrossSlotException [[B.ByteString]] deriving (Show)
instance Exception CrossSlotException

connect :: [CMD.CommandInfo] -> MVar ShardMap -> Maybe Int -> Hooks -> IO Connection
Expand Down
5 changes: 2 additions & 3 deletions src/Database/Redis/Connection.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import qualified Data.ByteString.Char8 as Char8
import Data.Functor(void)
import qualified Data.IntMap.Strict as IntMap
import Data.Pool
import Data.Typeable
import qualified Data.Time as Time
import Network.TLS (ClientParams)
import qualified Network.Socket as NS
Expand Down Expand Up @@ -97,7 +96,7 @@ data ConnectInfo = ConnInfo

data ConnectError = ConnectAuthError Reply
| ConnectSelectError Reply
deriving (Eq, Show, Typeable)
deriving (Eq, Show)

instance Exception ConnectError

Expand Down Expand Up @@ -203,7 +202,7 @@ runRedis (ClusteredConnection _ pool) redis =
withResource pool $ \conn -> runRedisClusteredInternal conn (refreshShardMap conn) redis

newtype ClusterConnectError = ClusterConnectError Reply
deriving (Eq, Show, Typeable)
deriving (Eq, Show)

instance Exception ClusterConnectError

Expand Down
3 changes: 1 addition & 2 deletions src/Database/Redis/ConnectionContext.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import qualified Data.ByteString.Lazy as LB
import qualified Data.IORef as IOR
import Control.Concurrent.MVar(newMVar, readMVar, swapMVar)
import Control.Exception(bracketOnError, Exception, throwIO, try)
import Data.Typeable
import Data.Functor(void)
import qualified Network.Socket as NS
import qualified Network.TLS as TLS
Expand Down Expand Up @@ -51,7 +50,7 @@ data ConnectPhase
deriving (Show)

newtype ConnectTimeout = ConnectTimeout ConnectPhase
deriving (Show, Typeable)
deriving (Show)

instance Exception ConnectTimeout

Expand Down
Loading
Loading