Skip to content

Commit

Permalink
hlint + fix cabal.project
Browse files Browse the repository at this point in the history
  • Loading branch information
nitinprakash96 committed Mar 6, 2024
1 parent 78986de commit 4206fb4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'azure-auth/azure-auth.cabal'
# haskell-ci 'github' '--config=cabal.haskell-ci' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
Expand All @@ -10,7 +10,7 @@
#
# version: 0.16.6
#
# REGENDATA ("0.16.6",["github","azure-auth/azure-auth.cabal"])
# REGENDATA ("0.16.6",["github","--config=cabal.haskell-ci","cabal.project"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -121,6 +121,11 @@ jobs:
- name: update cabal index
run: |
$CABAL v2-update -v
- name: cache (tools)
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-16576a04
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
Expand All @@ -130,14 +135,26 @@ jobs:
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
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.6 && <3.7' | 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
- name: save cache (tools)
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-16576a04
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v3
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/azure-auth" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/./azure-auth" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand Down Expand Up @@ -185,6 +202,9 @@ jobs:
- name: tests
run: |
$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_azure_auth} && hlint -XHaskell2010 -XDataKinds -XDerivingStrategies -XDerivingVia -XLambdaCase -XNoImportQualifiedPost -XNoGeneralisedNewtypeDeriving -XOverloadedStrings -XOverloadedLabels -XRecordWildCards -XTypeFamilies -XViewPatterns src) ; fi
- name: cabal check
run: |
cd ${PKGDIR_azure_auth} || false
Expand Down
2 changes: 2 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hlint: True
hlint-version: >=3.6 && <3.7
3 changes: 1 addition & 2 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packages:
azure-auth/

./azure-auth

0 comments on commit 4206fb4

Please sign in to comment.