diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index e57605a..1a63f0d 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,6 +1,6 @@ # This GitHub workflow config has been generated by a script via # -# haskell-ci 'github' 'integer-logarithms.cabal' +# haskell-ci 'github' 'cabal.project' # # To regenerate the script (for example after adjusting tested-with) run # @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.19.20241220 +# version: 0.19.20260104 # -# REGENDATA ("0.19.20241220",["github","integer-logarithms.cabal"]) +# REGENDATA ("0.19.20260104",["github","cabal.project"]) # name: Haskell-CI on: @@ -20,10 +20,13 @@ on: pull_request: branches: - master + merge_group: + branches: + - master jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 60 container: @@ -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.2 compilerKind: ghc - compilerVersion: 9.10.1 + compilerVersion: 9.10.2 setup-method: ghcup allow-failure: false - compiler: ghc-9.8.4 @@ -91,13 +99,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 (prerelease) + - name: Install cabal-install run: | - "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml; - "$HOME/.ghcup/bin/ghcup" install cabal 3.15.0.0.2024.10.3 || (cat "$HOME"/.ghcup/logs/*.* && false) - echo "CABAL=$HOME/.ghcup/bin/cabal-3.15.0.0.2024.10.3 -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: | @@ -173,7 +180,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 @@ -198,8 +205,13 @@ jobs: touch cabal.project.local echo "packages: ${PKGDIR_integer_logarithms}" >> cabal.project echo "package integer-logarithms" >> 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 integer-logarithms" >> 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 integer-logarithms" >> 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 <> cabal.project.local cat cabal.project diff --git a/cabal.haskell-ci b/cabal.haskell-ci index f8a9525..3d11edf 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,5 +1,4 @@ branches: master -tests: >=7.4 head-hackage: False constraint-set check-bounds diff --git a/cabal.project b/cabal.project index 1c61fed..a067ff4 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,8 @@ packages: . tests: True --- helpful with GHC HEAD --- constraints: QuickCheck -templatehaskell +if impl(ghc >=9.10) + package integer-logarithms + ghc-options: -Wunused-packages + +allow-newer: splitmix-0.1.3.1:base diff --git a/integer-logarithms.cabal b/integer-logarithms.cabal index 6776671..a3697a8 100644 --- a/integer-logarithms.cabal +++ b/integer-logarithms.cabal @@ -1,5 +1,5 @@ name: integer-logarithms -version: 1.0.4 +version: 1.0.5 cabal-version: >=1.10 author: Daniel Fischer copyright: @@ -23,16 +23,17 @@ description: category: Math, Algorithms, Number Theory tested-with: - GHC ==8.6.5 - || ==8.8.4 - || ==8.10.4 - || ==9.0.2 - || ==9.2.8 - || ==9.4.8 - || ==9.6.6 - || ==9.8.4 - || ==9.10.1 - || ==9.12.1 + GHC ==8.6.5 + || ==8.8.4 + || ==8.10.4 + || ==9.0.2 + || ==9.2.8 + || ==9.4.8 + || ==9.6.6 + || ==9.8.4 + || ==9.10.2 + || ==9.12.2 + || ==9.14.1 extra-source-files: changelog.md @@ -52,17 +53,14 @@ library default-language: Haskell2010 hs-source-dirs: src build-depends: - array >=0.5.3.0 && <0.6 - , base >=4.12.0.0 && <4.22 - , ghc-prim <0.14 + array >=0.5.3.0 && <0.6 + , base >=4.12.0.0 && <4.23 if !impl(ghc >=7.10) build-depends: nats >=1.1.2 && <1.2 if impl(ghc >=9.0) - build-depends: - base >=4.15 - , ghc-bignum >=1.0 && <1.4 + build-depends: base >=4.15 if !flag(integer-gmp) build-depends: invalid-cabal-flag-settings <0 @@ -113,12 +111,11 @@ test-suite spec build-depends: base , integer-logarithms - , QuickCheck >=2.14.1 && <2.16 - , smallcheck >=1.2 && <1.3 - , tasty >=1.4 && <1.6 - , tasty-hunit >=0.10 && <0.11 - , tasty-quickcheck >=0.10 && <0.12 - , tasty-smallcheck >=0.8 && <0.9 + , QuickCheck >=2.16.0.0 && <2.18 + , smallcheck >=1.2 && <1.3 + , tasty >=1.4 && <1.6 + , tasty-quickcheck >=0.10 && <0.12 + , tasty-smallcheck >=0.8 && <0.9 other-modules: Math.NumberTheory.LogarithmsTests diff --git a/test-suite/Orphans.hs b/test-suite/Orphans.hs index be96c5b..ff6d352 100644 --- a/test-suite/Orphans.hs +++ b/test-suite/Orphans.hs @@ -1,12 +1,15 @@ +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Orphans () where import Numeric.Natural (Natural) import Test.QuickCheck (Arbitrary (..)) +#if !MIN_VERSION_QuickCheck(2,17,0) -- | The QuickCheck-2.10 doesn't define the Arbitrary Natural instance -- We define own instance (and not use quickcheck-instance) to break -- the cycle in tests. instance Arbitrary Natural where arbitrary = fmap (fromInteger . abs) arbitrary shrink = map (fromInteger . abs) . shrink . fromIntegral +#endif