From 991a72c90a3b0dc10e959c3e154262db5a33dd99 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Fri, 8 Dec 2023 14:49:53 +0300 Subject: [PATCH] Update haskell-ci, support GHC >=9.4 --- .github/workflows/haskell-ci.yml | 40 ++++++++++++++++++++++++-------- cabal.haskell-ci | 2 +- cabal.project | 3 +++ package.yaml | 15 ++++++------ src/Bio/Uniprot/Parser.hs | 8 ++++++- 5 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 cabal.project diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 007b257..d2b1efa 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' 'cobot-io.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.16.6 +# version: 0.17.20231110 # -# REGENDATA ("0.16.6",["github","cobot-io.cabal"]) +# REGENDATA ("0.17.20231110",["github","cabal.project"]) # name: Haskell-CI on: @@ -32,11 +32,26 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.8.1 + compilerKind: ghc + compilerVersion: 9.8.1 + setup-method: ghcup + allow-failure: true + - compiler: ghc-9.6.3 + compilerKind: ghc + compilerVersion: 9.6.3 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.4.8 + compilerKind: ghc + compilerVersion: 9.4.8 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.2.8 compilerKind: ghc compilerVersion: 9.2.8 setup-method: ghcup - allow-failure: true + allow-failure: false - compiler: ghc-9.0.2 compilerKind: ghc compilerVersion: 9.0.2 @@ -54,10 +69,10 @@ jobs: apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -69,11 +84,13 @@ jobs: echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER - HC=$HOME/.ghcup/bin/$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=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$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" @@ -168,6 +185,9 @@ jobs: echo "package cobot-io" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <=9.2 +allow-failures: >=9.8 local-ghc-options: -Wall -Werror -fkeep-going diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..d868753 --- /dev/null +++ b/cabal.project @@ -0,0 +1,3 @@ +packages: *.cabal + +allow-newer: hyraxAbif:text, hyraxAbif:bytestring diff --git a/package.yaml b/package.yaml index 3e9efb5..b8fe9c7 100644 --- a/package.yaml +++ b/package.yaml @@ -23,10 +23,9 @@ tested-with: | GHC ==8.10.7 || ==9.0.2 || ==9.2.8 - -# hyraxAbif does not support text >= 1.3 yet -# || ==9.4.5 -# || ==9.6.2 + || ==9.4.8 + || ==9.6.3 + || ==9.8.1 # Metadata used when publishing your package @@ -40,11 +39,11 @@ dependencies: - array >= 0.5 && < 0.6 - attoparsec >= 0.10 && < 0.15 - binary >= 0.8.3.0 && < 1.0 -- bytestring >= 0.10.8.1 && < 0.12 +- bytestring >= 0.10.8.1 && < 0.13 - cobot >= 0.1.1.7 - containers >= 0.5.7.1 && < 0.7 - data-msgpack >= 0.0.9 && < 0.1 -- deepseq >= 1.4 && < 1.5 +- deepseq >= 1.4 && < 1.6 - filepath - http-conduit >= 2.3 && < 2.4 - hyraxAbif >= 0.2.3.27 && < 0.2.5.0 @@ -54,7 +53,7 @@ dependencies: - mtl >= 2.2.1 && < 2.4 - parser-combinators >= 1.2.1 - split -- text >= 1.2.2.1 && < 2.1 +- text >= 1.2.2.1 && < 2.2 - vector library: @@ -97,7 +96,7 @@ tests: - cobot-io - directory - QuickCheck >= 2.9.2 && < 2.15 - - hspec >= 2.4.1 && < 2.11 + - hspec >= 2.4.1 && < 2.12 - neat-interpolation >= 0.3 - linear - megaparsec diff --git a/src/Bio/Uniprot/Parser.hs b/src/Bio/Uniprot/Parser.hs index 51cbb12..aa1d1ad 100644 --- a/src/Bio/Uniprot/Parser.hs +++ b/src/Bio/Uniprot/Parser.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -9,8 +10,13 @@ module Bio.Uniprot.Parser where import Prelude hiding (null) import qualified Prelude as P (concat, init, last, null, tail) -import Bio.Uniprot.Type +#if MIN_VERSION_base(4, 18, 0) +import Control.Applicative ((<|>)) +#else import Control.Applicative (liftA2, (<|>)) +#endif + +import Bio.Uniprot.Type import Control.Monad (unless) import Data.Attoparsec.Text import Data.Bifunctor (second)