Skip to content

Commit

Permalink
Merge pull request #21 from bellroy/package-updates-2023-10
Browse files Browse the repository at this point in the history
Package updates 2023 10
  • Loading branch information
JackKelly-Bellroy authored Oct 20, 2023
2 parents 2d280e1 + 2dddb55 commit f3ce26c
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 101 deletions.
72 changes: 24 additions & 48 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.16.3
# version: 0.16.6
#
# REGENDATA ("0.16.3",["github","aws-arn.cabal","--hlint","--doctest"])
# REGENDATA ("0.16.6",["github","aws-arn.cabal","--hlint","--doctest"])
#
name: Haskell-CI
on:
Expand All @@ -28,9 +28,14 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.2.1
- compiler: ghc-9.4.5
compilerKind: ghc
compilerVersion: 9.2.1
compilerVersion: 9.4.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.5
compilerKind: ghc
compilerVersion: 9.2.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.2
Expand All @@ -43,37 +48,17 @@ 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.6.5
compilerKind: ghc
compilerVersion: 8.6.5
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
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
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)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -85,20 +70,11 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
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
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"
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 @@ -165,10 +141,10 @@ jobs:
doctest --version
- name: install hlint
run: |
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.5 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then hlint --version ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.5 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then hlint --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v3
if: always()
Expand Down Expand Up @@ -236,7 +212,7 @@ jobs:
doctest -XHaskell2010 src
- name: hlint
run: |
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then (cd ${PKGDIR_aws_arn} && hlint -XHaskell2010 src) ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then (cd ${PKGDIR_aws_arn} && hlint -XHaskell2010 src) ; fi
- name: cabal check
run: |
cd ${PKGDIR_aws_arn} || false
Expand Down
8 changes: 4 additions & 4 deletions aws-arn.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extra-source-files:
README.md

tested-with:
GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.1
GHC ==8.10.7 || ==9.0.2 || ==9.2.5 || ==9.4.5

common opts
default-language: Haskell2010
Expand All @@ -51,11 +51,11 @@ common opts

common deps
build-depends:
, base >=4.12 && <4.18
, base >=4.12 && <4.19
, deriving-compat >=0.5.10 && <0.7
, profunctors >=5.0 && <5.7
, tagged ^>=0.8
, text ^>=1.2.3 || ^>=2.0
, text ^>=1.2.3 || >=2.0 && <2.1 || ^>=2.1

library
import: opts, deps
Expand All @@ -81,7 +81,7 @@ test-suite spec
ghc-options: -threaded
build-depends:
, aws-arn
, tasty ^>=1.4.0.2
, tasty >=1.4.0.2 && <1.5 || ^>=1.5
, tasty-hunit ^>=0.10.0.3

build-tool-depends: tasty-discover:tasty-discover >=4.2.2 && <5.1
Expand Down
2 changes: 1 addition & 1 deletion aws-arn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}:
mkDerivation {
pname = "aws-arn";
version = "0.3.0.0";
version = "0.3.1.0";
src = ./.;
libraryHaskellDepends = [
base deriving-compat hashable profunctors tagged text
Expand Down
37 changes: 29 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 12 additions & 40 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,21 @@
description = "Types and optics for manipulating Amazon Resource Names (ARNs)";

inputs = {
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
bellroy-nix-foss = {
url = "github:bellroy/bellroy-nix-foss";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
};

outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import inputs.nixpkgs { inherit system; };
makePackage = haskellPackages: (haskellPackages.override {
overrides = final: prev: with pkgs.haskell.lib; {
hedgehog = prev.callHackage "hedgehog" "1.2" { };
tasty-discover = prev.callHackage "tasty-discover" "5.0.0" { };
tasty-hedgehog = prev.callHackage "tasty-hedgehog" "1.4.0.0" { };
};
}).callPackage ./aws-arn.nix
{ };
in
rec
outputs = inputs: inputs.bellroy-nix-foss.lib.haskellProject {
cabalPackages = [
{
packages = {
default = makePackage pkgs.haskellPackages;
ghc884 = makePackage pkgs.haskell.packages.ghc884;
ghc902 = makePackage pkgs.haskell.packages.ghc902;
ghc925 = makePackage pkgs.haskell.packages.ghc925;
ghc943 = makePackage pkgs.haskell.packages.ghc943;
};

devShells = builtins.mapAttrs
(_: v: v.env.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs
++ [ pkgs.nixpkgs-fmt ]
++ (with pkgs.haskellPackages; [
cabal-install
cabal-fmt
doctest
haskell-ci
hlint
]);
}))
packages;
});
name = "aws-arn";
path = ./aws-arn.nix;
}
];
supportedCompilers = [ "ghc810" "ghc90" "ghc92" "ghc94" "ghc96" ];
defaultCompiler = "ghc92";
};
}

0 comments on commit f3ce26c

Please sign in to comment.