Skip to content

Commit

Permalink
still test with ghc 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jude Taylor committed Jul 16, 2023
1 parent 8892af4 commit ab0aa79
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 29 deletions.
58 changes: 46 additions & 12 deletions .github/workflows/haskell-ci.yml
Expand Up @@ -53,17 +53,42 @@ jobs:
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-8.0.2
compilerKind: ghc
compilerVersion: 8.0.2
setup-method: hvr-ppa
allow-failure: false
fail-fast: false
steps:
- name: apt
run: |
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"
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)
if [ "${{ matrix.setup-method }}" = ghcup ]; then
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"
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)
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
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"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -75,11 +100,20 @@ 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
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"
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
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"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi
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 @@ -160,8 +194,8 @@ jobs:
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_th_printf}" >> cabal.project
echo "package th-printf" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package th-printf" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(th-printf)$/; }' >> cabal.project.local
Expand Down
26 changes: 15 additions & 11 deletions CHANGELOG.md
@@ -1,21 +1,25 @@
## 0.8.0 (2023-07-16)

Support for base >= 4.15 / GHC 9.

## 0.7.0 (2019-09-12)

* New `%Q` and `%q` format specifiers accept strict and lazy Text as input
- New `%Q` and `%q` format specifiers accept strict and lazy Text as input
respectively. Otherwise they function identically to the `%s` specifier.
* th-printf can now produce lazy Text as well as String, and the improved
- th-printf can now produce lazy Text as well as String, and the improved
internal representation of format strings should slightly increase performance.
* Directly producing Text should now be significantly faster than using the
- Directly producing Text should now be significantly faster than using the
string formatter and `pack`ing the result, especially with Text format arguments.
* Dropped support for GHC < 8.
- Dropped support for GHC < 8.

## 0.6.0 (2018-08-18)

Backported new backpack-based code to pre GHC-8.4 versions.

* Rename of public modules
* Parser rewrite
* th-printf now prints a warning when given an erroneous format string
* Several printf behaviors have been updated to comply with spec:
* `x`, `u`, etc. specifiers now only apply to positive integers
* Length specifiers are allowed
* Generated testsuite covers more cases
- Rename of public modules
- Parser rewrite
- th-printf now prints a warning when given an erroneous format string
- Several printf behaviors have been updated to comply with spec:
- `x`, `u`, etc. specifiers now only apply to positive integers
- Length specifiers are allowed
- Generated testsuite covers more cases
4 changes: 2 additions & 2 deletions package.yaml
Expand Up @@ -4,7 +4,7 @@ synopsis: Quasiquoters for printf
description: Quasiquoters for string and text printf
author: Jude Taylor
maintainer: me@jude.xyz
tested-with: GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.5, GHC == 9.6.2
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.5, GHC == 9.6.2
extra-source-files:
- CHANGELOG.md
category: Text
Expand All @@ -23,7 +23,7 @@ when:
ghc-options: -Werror

dependencies:
- base == 4.*
- base >= 4.9 && < 5

library:
source-dirs: [src, parser]
Expand Down
8 changes: 4 additions & 4 deletions th-printf.cabal
Expand Up @@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 414f4e04ac83052cc8cacc595703e9530c7ff9266f6f3602868cd2efd091165a
-- hash: 6aeece5259e4fa083c76ffee3c6ae04aee3fb63236c08d5baa8d72c15f303e7c

name: th-printf
version: 0.8
Expand All @@ -18,7 +18,7 @@ maintainer: me@jude.xyz
license: MIT
license-file: LICENSE
tested-with:
GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.5, GHC == 9.6.2
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.5, GHC == 9.6.2
build-type: Simple
extra-source-files:
CHANGELOG.md
Expand Down Expand Up @@ -51,7 +51,7 @@ library
parser
ghc-options: -Wall
build-depends:
base ==4.*
base >=4.9 && <5
, charset
, containers
, dlist
Expand Down Expand Up @@ -80,7 +80,7 @@ test-suite format
build-depends:
HUnit
, QuickCheck
, base ==4.*
, base >=4.9 && <5
, hspec
, template-haskell
, text
Expand Down

0 comments on commit ab0aa79

Please sign in to comment.