diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 403ec3f..ffc6009 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -133,7 +133,7 @@ jobs: - name: cache (tools) uses: actions/cache/restore@v3 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-adb19217 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-fe2b9a2e path: ~/.haskell-ci-tools - name: install cabal-plan run: | @@ -146,15 +146,15 @@ jobs: cabal-plan --version - name: install hlint run: | - if [ $((HCNUMVER >= 90600)) -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 >= 90600)) -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 >= 90600)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi - if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then hlint --version ; fi + if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -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 && HCNUMVER < 90600)) -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 && HCNUMVER < 90600)) -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 && HCNUMVER < 90600)) -ne 0 ] ; then hlint --version ; fi - name: save cache (tools) uses: actions/cache/save@v3 if: always() with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-adb19217 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-fe2b9a2e path: ~/.haskell-ci-tools - name: checkout uses: actions/checkout@v3 @@ -221,10 +221,10 @@ jobs: $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: hlint run: | - if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then (cd ${PKGDIR_landlock} && hlint -XHaskell2010 src) ; fi - if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then (cd ${PKGDIR_landlock} && hlint -XHaskell2010 internal) ; fi - if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then (cd ${PKGDIR_landlock} && hlint -XHaskell2010 bin) ; fi - if [ $((HCNUMVER >= 90600)) -ne 0 ] ; then (cd ${PKGDIR_psx} && hlint -XHaskell2010 src) ; fi + if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_landlock} && hlint -XHaskell2010 src) ; fi + if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_landlock} && hlint -XHaskell2010 internal) ; fi + if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_landlock} && hlint -XHaskell2010 bin) ; fi + if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_psx} && hlint -XHaskell2010 src) ; fi - name: cabal check run: | cd ${PKGDIR_landlock} || false diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 7618bde..faf5c3d 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -3,6 +3,7 @@ Github-Patches: .github/workflows/haskell-ci.patch Distribution: jammy Hlint: True +Hlint-Job: 9.4.2 Constraint-Set unix-2.7 Constraints: unix ^>=2.7