Skip to content

Commit 0c04f18

Browse files
committed
Updated CI
Also do not pin GHC version in cabal.project.
1 parent b71c06e commit 0c04f18

File tree

5 files changed

+17
-25
lines changed

5 files changed

+17
-25
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
- name: cache (tools)
124124
uses: actions/cache@v2
125125
with:
126-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-359ec286
126+
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-f9d9af4c
127127
path: ~/.haskell-ci-tools
128128
- name: install cabal-plan
129129
run: |
@@ -140,7 +140,7 @@ jobs:
140140
doctest --version
141141
- name: install hlint
142142
run: |
143-
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.5' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
143+
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.3 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
144144
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
145145
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
146146
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then hlint --version ; fi
@@ -163,28 +163,17 @@ jobs:
163163
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
164164
- name: generate cabal.project
165165
run: |
166-
PKGDIR_effectful_typed_process="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/effectful-typed-process-[0-9.]*')"
167-
echo "PKGDIR_effectful_typed_process=${PKGDIR_effectful_typed_process}" >> "$GITHUB_ENV"
166+
PKGDIR_typed_process_effectful="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/typed-process-effectful-[0-9.]*')"
167+
echo "PKGDIR_typed_process_effectful=${PKGDIR_typed_process_effectful}" >> "$GITHUB_ENV"
168168
rm -f cabal.project cabal.project.local
169169
touch cabal.project
170170
touch cabal.project.local
171-
echo "packages: ${PKGDIR_effectful_typed_process}" >> cabal.project
172-
echo "package effectful-typed-process" >> cabal.project
171+
echo "packages: ${PKGDIR_typed_process_effectful}" >> cabal.project
172+
echo "package typed-process-effectful" >> cabal.project
173173
echo " ghc-options: -Werror=missing-methods" >> cabal.project
174174
cat >> cabal.project <<EOF
175-
source-repository-package
176-
type: git
177-
location: https://github.com/haskell-effectful/effectful.git
178-
tag: cfd958d
179-
subdir: effectful
180-
181-
source-repository-package
182-
type: git
183-
location: https://github.com/haskell-effectful/effectful.git
184-
tag: cfd958d
185-
subdir: effectful-core
186175
EOF
187-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(effectful-typed-process)$/; }' >> cabal.project.local
176+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(typed-process-effectful)$/; }' >> cabal.project.local
188177
cat cabal.project
189178
cat cabal.project.local
190179
- name: dump install plan
@@ -212,14 +201,14 @@ jobs:
212201
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
213202
- name: doctest
214203
run: |
215-
cd ${PKGDIR_effectful_typed_process} || false
204+
cd ${PKGDIR_typed_process_effectful} || false
216205
doctest -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src
217206
- name: hlint
218207
run: |
219-
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then (cd ${PKGDIR_effectful_typed_process} && hlint -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src) ; fi
208+
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then (cd ${PKGDIR_typed_process_effectful} && hlint -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src) ; fi
220209
- name: cabal check
221210
run: |
222-
cd ${PKGDIR_effectful_typed_process} || false
211+
cd ${PKGDIR_typed_process_effectful} || false
223212
${CABAL} -vnormal check
224213
- name: haddock
225214
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cabal.project.local
12
dist-newstyle
23
.hie
34
.hspec-failures

cabal.haskell-ci

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ branches: main
22

33
doctest: <9.3
44
hlint: True
5-
hlint-version: >=3.3 && <3.5
5+
hlint-version: >=3.3 && <3.6
66
tests: True
77
benchmarks: True
8+
9+
ghcup-jobs: True

cabal.project

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
packages: ./
2-
3-
with-compiler: ghc-8.10
1+
packages: ./typed-process-effectful.cabal

typed-process-effectful.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ extra-source-files:
2828
LICENSE.md
2929
README.md
3030

31+
tested-with: GHC==9.2.2, GHC==9.0.2, GHC==8.10.7
32+
3133
source-repository head
3234
type: git
3335
location:

0 commit comments

Comments
 (0)