Skip to content

Commit

Permalink
Update haskell-ci, support GHC >=9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan committed Dec 8, 2023
1 parent cd74def commit 991a72c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 20 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# 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
#
# haskell-ci regenerate
#
# 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:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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"
Expand Down Expand Up @@ -168,6 +185,9 @@ jobs:
echo "package cobot-io" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: hyraxAbif:text
allow-newer: hyraxAbif:bytestring
package cobot-io
ghc-options: -Wall -Werror -fkeep-going
EOF
Expand Down
2 changes: 1 addition & 1 deletion cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ distribution: focal

branches: master

allow-failures: >=9.2
allow-failures: >=9.8

local-ghc-options: -Wall -Werror -fkeep-going
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages: *.cabal

allow-newer: hyraxAbif:text, hyraxAbif:bytestring
15 changes: 7 additions & 8 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
8 changes: 7 additions & 1 deletion src/Bio/Uniprot/Parser.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
Expand All @@ -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)
Expand Down

0 comments on commit 991a72c

Please sign in to comment.