From 14c5bdbd049c6a3876ff8cdcf2b05b4d9e4a0878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0ebek?= Date: Thu, 9 Jun 2022 01:11:57 +0200 Subject: [PATCH] Move HLint to GHC 8.10.7 in CI The version check only cares about 8/9 and HLint has some trouble installing in 9.2, so this avoids it for now. --- .github/workflows/haskell-ci.yml | 14 +++++++------- cabal.haskell-ci | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index dda36e1f..6c1029b5 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -144,7 +144,7 @@ jobs: - name: cache (tools) uses: actions/cache@v2 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2a842658 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-436fbe9d path: ~/.haskell-ci-tools - name: install cabal-plan run: | @@ -166,10 +166,10 @@ jobs: cabal-docspec --version - name: install hlint run: | - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.4' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi - if [ $((HCNUMVER >= 90000)) -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 >= 90000)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then hlint --version ; fi + if [ $((HCNUMVER < 90000)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.4' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi + if [ $((HCNUMVER < 90000)) -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 < 90000)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi + if [ $((HCNUMVER < 90000)) -ne 0 ] ; then hlint --version ; fi - name: checkout uses: actions/checkout@v2 with: @@ -229,8 +229,8 @@ jobs: cabal-docspec $ARG_COMPILER - name: hlint run: | - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XStrictData src) ; fi - if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 app) ; fi + if [ $((HCNUMVER < 90000)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XStrictData src) ; fi + if [ $((HCNUMVER < 90000)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 app) ; fi - name: cabal check run: | cd ${PKGDIR_swarm} || false diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 3a3ec4e7..a2fc24bf 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -19,7 +19,7 @@ benchmarks: True -- Run HLint hlint: True -hlint-job: 9.0.2 +hlint-job: 8.10.7 hlint-yaml: .hlint.yaml hlint-download-binary: True