diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index a0f3962..2676a4c 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -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: @@ -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 @@ -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 }} @@ -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" @@ -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() @@ -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 diff --git a/aws-arn.cabal b/aws-arn.cabal index b565fb2..48e3f0c 100644 --- a/aws-arn.cabal +++ b/aws-arn.cabal @@ -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 @@ -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 @@ -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 diff --git a/aws-arn.nix b/aws-arn.nix index bc5378c..dea291b 100644 --- a/aws-arn.nix +++ b/aws-arn.nix @@ -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 diff --git a/flake.lock b/flake.lock index 1d0b389..ce5cfa1 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,27 @@ { "nodes": { + "bellroy-nix-foss": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1693268846, + "narHash": "sha256-w3yK1C6/JsBVvZRKnZw4HPBajYWpcA2BR3t13mfALzE=", + "owner": "bellroy", + "repo": "bellroy-nix-foss", + "rev": "5c8b2fe6bf30b858dce75809d0caf6ccbf1c9f0e", + "type": "github" + }, + "original": { + "owner": "bellroy", + "repo": "bellroy-nix-foss", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -21,11 +43,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "lastModified": 1687709756, + "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", "owner": "numtide", "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", "type": "github" }, "original": { @@ -36,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1692661598, - "narHash": "sha256-a+ZFNMcqZsB0tTkSM0LvYtxk1IUmWlFc42JWnR4AeAE=", + "lastModified": 1697700926, + "narHash": "sha256-4tQvS/t7Dt19L7GwjZ2D2r3M0LKtFxhG6BEGitDyUhQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a1a55a20a6a4687bd6ec69638a27047a9ba0fbb3", + "rev": "2bbf67d3c76927b5c3148f32c0e93c14e5dbc2d9", "type": "github" }, "original": { @@ -51,8 +73,7 @@ }, "root": { "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "bellroy-nix-foss": "bellroy-nix-foss", "nixpkgs": "nixpkgs" } }, diff --git a/flake.nix b/flake.nix index f605f1e..427a97a 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; + }; }