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
38 changes: 25 additions & 13 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.20250216
# version: 0.19.20260102
#
# REGENDATA ("0.19.20250216",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"])
# REGENDATA ("0.19.20260102",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -20,6 +20,9 @@ on:
pull_request:
branches:
- master
merge_group:
branches:
- master
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
Expand All @@ -32,14 +35,19 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.12.1
- compiler: ghc-9.14.1
compilerKind: ghc
compilerVersion: 9.14.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.12.2
compilerKind: ghc
compilerVersion: 9.12.1
compilerVersion: 9.12.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.1
- compiler: ghc-9.10.3
compilerKind: ghc
compilerVersion: 9.10.1
compilerVersion: 9.10.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.4
Expand Down Expand Up @@ -101,12 +109,12 @@ jobs:
- 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.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
"$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: |
Expand All @@ -131,7 +139,7 @@ jobs:
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
if [ $((HCNUMVER > 91201)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
Expand Down Expand Up @@ -194,7 +202,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -223,9 +231,13 @@ jobs:
echo "packages: ${PKGDIR_containers}" >> cabal.project
echo "packages: ${PKGDIR_containers_tests}" >> cabal.project
echo "package containers" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
echo "package containers-tests" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package containers" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package containers-tests" >> 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
allow-newer: all:containers
EOF
Expand Down
4 changes: 4 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ install-dependencies: False
installed: +all -binary -text

cabal-check: False

-- Stop haskell-ci from inserting -Werror=unused-packages
-- https://github.com/haskell-CI/haskell-ci/pull/789#issuecomment-3224566698
error-unused-packages: False
1 change: 1 addition & 0 deletions containers-tests/benchmarks/IntMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ maybeDel n | n `mod` 3 == 0 = Nothing
------------------------------------------------------------
interleave :: [Int] -> [Int] -> [Int]
interleave [] ys = ys
interleave xs [] = xs
interleave (x:xs) (y:ys) = x : y : interleave xs ys

unitValues :: [Int] -> [(Int, ())]
Expand Down
1 change: 1 addition & 0 deletions containers-tests/benchmarks/IntSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ fromListNoinline = IS.fromList

interleave :: [a] -> [a] -> [a]
interleave [] ys = ys
interleave xs [] = xs
interleave (x:xs) (y:ys) = x : y : interleave xs ys

gen :: StdGen
Expand Down
3 changes: 1 addition & 2 deletions containers-tests/benchmarks/Sequence.hs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ fakeDeleteAt i xs
-- and rejoin the pieces in the opposite order.
-- Finally getting the middle element forces the whole spine.
shuffle :: [Int] -> S.Seq Int -> Int
shuffle ps s = case S.viewl (S.drop (S.length s `div` 2) (foldl' cut s ps)) of
x S.:< _ -> x
shuffle ps s = S.index (foldl' cut s ps) (S.length s `div` 2)
where cut xs p = let (front, back) = S.splitAt p xs in back S.>< front

stateReplicate :: Int -> S.Seq Char
Expand Down
12 changes: 6 additions & 6 deletions containers-tests/containers-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extra-source-files:

tested-with:
GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 ||
==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.1 || ==9.12.1
==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.3 || ==9.12.2 || ==9.14.1

source-repository head
type: git
Expand All @@ -37,11 +37,14 @@ common deps
build-depends:
array >=0.4.0.0
, base >=4.10 && <5
, deepseq >=1.2 && <1.6
, deepseq >= 1.4.3.0 && < 1.6
, template-haskell

common warnings
ghc-options: -Werror=unused-top-binds
ghc-options:
-Werror=unused-top-binds
-Werror=incomplete-patterns
-Werror=incomplete-uni-patterns

common test-deps
import: deps
Expand All @@ -58,7 +61,6 @@ common benchmark-deps
import: deps
build-depends:
containers-tests
, deepseq >=1.1.0.0 && <1.6
, OneTuple
, tasty-bench >=0.3.1 && <0.5

Expand Down Expand Up @@ -295,7 +297,6 @@ benchmark lookupge-intmap
hs-source-dirs: benchmarks/LookupGE
main-is: IntMap.hs
other-modules: LookupGE_IntMap
build-depends: containers-tests

benchmark lookupge-map
import: benchmark-deps, warnings
Expand All @@ -304,7 +305,6 @@ benchmark lookupge-map
hs-source-dirs: benchmarks/LookupGE
main-is: Map.hs
other-modules: LookupGE_Map
build-depends: containers-tests
ghc-options: -O2

-------------------
Expand Down
13 changes: 9 additions & 4 deletions containers-tests/tests/intmap-properties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ prop_mergeWithKeyModel xs ys
(Nothing, Just y) -> if keep_y then Just (k, y) else Nothing
(Just x, Nothing) -> if keep_x then Just (k, x) else Nothing
(Just x, Just y) -> (\v -> (k, v)) `fmap` f k x y
(Nothing, Nothing) -> error "impossible"

-- We prevent inlining testMergeWithKey to disable the SpecConstr
-- optimalization. There are too many call patterns here so several
Expand Down Expand Up @@ -1951,14 +1952,18 @@ prop_maxViewWithKey m = case maxViewWithKey m of
prop_minView :: IntMap A -> Property
prop_minView m = case minView m of
Nothing -> property $ null m
Just (x,m') | ~(_,x'):xs' <- toList m ->
valid m' .&&. x == x' .&&. toList m' === xs'
Just (x,m') -> valid m' .&&. kxs === (minKey, x) : toList m'
where
kxs = toList m
minKey = minimum (fmap fst kxs)

prop_maxView :: IntMap A -> Property
prop_maxView m = case maxView m of
Nothing -> property $ null m
Just (x,m') | ~(_,x'):xs' <- toDescList m ->
valid m' .&&. x == x' .&&. toDescList m' === xs'
Just (x,m') -> valid m' .&&. kxs === (maxKey, x) : toDescList m'
where
kxs = toDescList m
maxKey = maximum (fmap fst kxs)

prop_mapEither :: Fun A (Either B C) -> IntMap A -> Property
prop_mapEither f m =
Expand Down
13 changes: 9 additions & 4 deletions containers-tests/tests/map-properties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ prop_mergeWithKeyModel xs ys
(Nothing, Just y) -> if keep_y then Just (k, y) else Nothing
(Just x, Nothing) -> if keep_x then Just (k, x) else Nothing
(Just x, Just y) -> (\v -> (k, v)) `fmap` f k x y
(Nothing, Nothing) -> error "impossible"

-- We prevent inlining testMergeWithKey to disable the SpecConstr
-- optimalization. There are too many call patterns here so several
Expand Down Expand Up @@ -1914,14 +1915,18 @@ prop_maxViewWithKey m = case maxViewWithKey m of
prop_minView :: Map Int A -> Property
prop_minView m = case minView m of
Nothing -> property $ null m
Just (x,m') | ~(_,x'):xs' <- toList m ->
valid m' .&&. x == x' .&&. toList m' === xs'
Just (x,m') -> valid m' .&&. kxs === (minKey, x) : toList m'
where
kxs = toList m
minKey = minimum (fmap fst kxs)

prop_maxView :: Map Int A -> Property
prop_maxView m = case maxView m of
Nothing -> property $ null m
Just (x,m') | ~(_,x'):xs' <- toDescList m ->
valid m' .&&. x == x' .&&. toDescList m' === xs'
Just (x,m') -> valid m' .&&. kxs === (maxKey, x) : toDescList m'
where
kxs = toDescList m
maxKey = maximum (fmap fst kxs)

prop_isSubmapOf :: Map Int A -> Map Int A -> Property
prop_isSubmapOf m1 m2 = isSubmapOf m1 m2 === all (`elem` kys) (toList m1)
Expand Down
2 changes: 1 addition & 1 deletion containers/containers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extra-source-files:

tested-with:
GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 ||
==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.1 || ==9.12.1
==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.3 || ==9.12.2 || ==9.14.1

source-repository head
type: git
Expand Down