Skip to content

Commit 07503ef

Browse files
authored
Merge pull request #767 from phadej/haskell-ci-2
CI: test with HLint and +cffi flag
2 parents 0c39424 + 38e1d89 commit 07503ef

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.hlint.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@
99
name: "Use newtype instead of data"
1010
within:
1111
- Data.Aeson.Types.Internal
12+
13+
# CPP confuses
14+
- ignore:
15+
name: "Use fewer imports"
16+
within:
17+
- Data.Aeson.Types.Internal

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ install:
9898
- cat $CABALHOME/config
9999
- rm -fv cabal.project cabal.project.local cabal.project.freeze
100100
- travis_retry ${CABAL} v2-update -v
101+
- if [ $HCNUMVER -ge 80800 ] && [ $HCNUMVER -lt 81000 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $WITHCOMPILER --dry-run hlint --constraint='hlint ==2.2.*' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
102+
- "if [ $HCNUMVER -ge 80800 ] && [ $HCNUMVER -lt 81000 ] ; then if [ ! -e $HOME/.hlint/hlint-$HLINTVER/hlint ]; then echo \"Downloading HLint version $HLINTVER\"; mkdir -p $HOME/.hlint; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\\n' --silent --location --output $HOME/.hlint/hlint-$HLINTVER.tar.gz \"https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz\"; tar -xzv -f $HOME/.hlint/hlint-$HLINTVER.tar.gz -C $HOME/.hlint; fi ; fi"
103+
- if [ $HCNUMVER -ge 80800 ] && [ $HCNUMVER -lt 81000 ] ; then mkdir -p $CABALHOME/bin && ln -sf "$HOME/.hlint/hlint-$HLINTVER/hlint" $CABALHOME/bin/hlint ; fi
104+
- if [ $HCNUMVER -ge 80800 ] && [ $HCNUMVER -lt 81000 ] ; then hlint --version ; fi
101105
# Generate cabal.project
102106
- rm -rf cabal.project cabal.project.local cabal.project.freeze
103107
- touch cabal.project
@@ -152,11 +156,19 @@ script:
152156
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
153157
# Testing...
154158
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
159+
# HLint..
160+
- if [ $HCNUMVER -ge 80800 ] && [ $HCNUMVER -lt 81000 ] ; then (cd ${PKGDIR_aeson} && hlint -h ${TOP}/.hlint.yaml . attoparsec-iso8601/ pure ffi) ; fi
161+
- if [ $HCNUMVER -ge 80800 ] && [ $HCNUMVER -lt 81000 ] ; then (cd ${PKGDIR_attoparsec_iso8601} && hlint -h ${TOP}/.hlint.yaml .) ; fi
155162
# haddock...
156163
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
157164
# Building without installed constraints for packages in global-db...
158165
- rm -f cabal.project.local
159166
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
167+
# Constraint sets
168+
- rm -rf cabal.project.local
169+
# Constraint set cffi
170+
- ${CABAL} v2-build $WITHCOMPILER --enable-tests --disable-benchmarks --constraint='aeson +cffi' all
171+
- ${CABAL} v2-test $WITHCOMPILER --enable-tests --disable-benchmarks --constraint='aeson +cffi' all
160172

161173
# REGENDATA ("0.9.20200402",["--config=cabal.haskell-ci","cabal.project"])
162174
# EOF

cabal.haskell-ci

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
cabal-check: False
22
email-notifications: False
3+
4+
hlint: True
5+
hlint-job: 8.8.3
6+
hlint-yaml: .hlint.yaml
7+
8+
constraint-set cffi
9+
constraints: aeson +cffi
10+
tests: True
11+
run-tests: True

0 commit comments

Comments
 (0)