Skip to content

Commit 9ab8c60

Browse files
committed
Updated CI and adjusted version bounds
1 parent 0c04f18 commit 9ab8c60

File tree

4 files changed

+63
-31
lines changed

4 files changed

+63
-31
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.14.3
11+
# version: 0.16
1212
#
13-
# REGENDATA ("0.14.3",["github","cabal.project"])
13+
# REGENDATA ("0.16",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-18.04
26+
runs-on: ubuntu-20.04
2727
timeout-minutes:
2828
60
2929
container:
@@ -32,9 +32,19 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.2.2
35+
- compiler: ghc-9.6.1
3636
compilerKind: ghc
37-
compilerVersion: 9.2.2
37+
compilerVersion: 9.6.1
38+
setup-method: ghcup
39+
allow-failure: false
40+
- compiler: ghc-9.4.4
41+
compilerKind: ghc
42+
compilerVersion: 9.4.4
43+
setup-method: ghcup
44+
allow-failure: false
45+
- compiler: ghc-9.2.7
46+
compilerKind: ghc
47+
compilerVersion: 9.2.7
3848
setup-method: ghcup
3949
allow-failure: false
4050
- compiler: ghc-9.0.2
@@ -54,10 +64,10 @@ jobs:
5464
apt-get update
5565
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
5666
mkdir -p "$HOME/.ghcup/bin"
57-
curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup"
67+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
5868
chmod a+x "$HOME/.ghcup/bin/ghcup"
59-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
60-
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
69+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
70+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
6171
env:
6272
HCKIND: ${{ matrix.compilerKind }}
6373
HCNAME: ${{ matrix.compiler }}
@@ -73,7 +83,7 @@ jobs:
7383
echo "HC=$HC" >> "$GITHUB_ENV"
7484
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
7585
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
76-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
86+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
7787
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
7888
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
7989
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
@@ -121,31 +131,37 @@ jobs:
121131
run: |
122132
$CABAL v2-update -v
123133
- name: cache (tools)
124-
uses: actions/cache@v2
134+
uses: actions/cache/restore@v3
125135
with:
126-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-f9d9af4c
136+
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2ac3c456
127137
path: ~/.haskell-ci-tools
128138
- name: install cabal-plan
129139
run: |
130140
mkdir -p $HOME/.cabal/bin
131-
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
132-
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
141+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
142+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
133143
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
134144
rm -f cabal-plan.xz
135145
chmod a+x $HOME/.cabal/bin/cabal-plan
136146
cabal-plan --version
137147
- name: install doctest
138148
run: |
139-
$CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20'
140-
doctest --version
149+
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' ; fi
150+
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest --version ; fi
141151
- name: install hlint
142152
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.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
144-
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
145-
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
146-
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then hlint --version ; fi
153+
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -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
154+
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
155+
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
156+
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then hlint --version ; fi
157+
- name: save cache (tools)
158+
uses: actions/cache/save@v3
159+
if: always()
160+
with:
161+
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2ac3c456
162+
path: ~/.haskell-ci-tools
147163
- name: checkout
148-
uses: actions/checkout@v2
164+
uses: actions/checkout@v3
149165
with:
150166
path: source
151167
- name: initial cabal.project for sdist
@@ -180,8 +196,8 @@ jobs:
180196
run: |
181197
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
182198
cabal-plan
183-
- name: cache
184-
uses: actions/cache@v2
199+
- name: restore cache
200+
uses: actions/cache/restore@v3
185201
with:
186202
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
187203
path: ~/.cabal/store
@@ -201,19 +217,25 @@ jobs:
201217
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
202218
- name: doctest
203219
run: |
204-
cd ${PKGDIR_typed_process_effectful} || false
205-
doctest -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src
220+
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cd ${PKGDIR_typed_process_effectful} || false ; fi
221+
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then doctest -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src ; fi
206222
- name: hlint
207223
run: |
208-
if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then (cd ${PKGDIR_typed_process_effectful} && hlint -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src) ; fi
224+
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_typed_process_effectful} && hlint -XHaskell2010 -XDataKinds -XFlexibleContexts -XGADTs -XKindSignatures -XTypeOperators src) ; fi
209225
- name: cabal check
210226
run: |
211227
cd ${PKGDIR_typed_process_effectful} || false
212228
${CABAL} -vnormal check
213229
- name: haddock
214230
run: |
215-
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
231+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
216232
- name: unconstrained build
217233
run: |
218234
rm -f cabal.project.local
219235
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
236+
- name: save cache
237+
uses: actions/cache/save@v3
238+
if: always()
239+
with:
240+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
241+
path: ~/.cabal/store

cabal.haskell-ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ branches: main
22

33
doctest: <9.3
44
hlint: True
5+
hlint-job: 9.4.4
56
hlint-version: >=3.3 && <3.6
67
tests: True
78
benchmarks: True

src/Effectful/Process/Typed.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This module provides [effectful](https://hackage.haskell.org/package/effectful)
99
bindings for [typed-process](https://hackage.haskell.org/package/typed-process).
1010
-}
1111
{-# OPTIONS_GHC -fno-warn-dodgy-imports #-}
12+
{-# LANGUAGE CPP #-}
1213
{-# LANGUAGE TypeFamilies #-}
1314
module Effectful.Process.Typed
1415
( -- * Process effect
@@ -40,6 +41,9 @@ module Effectful.Process.Typed
4041

4142
-- * Re-exports from "System.Process.Typed"
4243
, module Reexport
44+
#if ! MIN_VERSION_typed_process(0,2,8)
45+
, ExitCode(..)
46+
#endif
4347
) where
4448

4549
import System.Process.Typed as Reexport hiding
@@ -72,6 +76,10 @@ import Effectful.Internal.Monad
7276
import Effectful (Dispatch(..), DispatchOf)
7377
import Effectful.Dispatch.Static (SideEffects(..))
7478

79+
#if ! MIN_VERSION_typed_process(0,2,8)
80+
import System.Exit (ExitCode(..))
81+
#endif
82+
7583
-- | An effect for running child processes using the @typed-process@ library.
7684
data TypedProcess :: Effect
7785

typed-process-effectful.cabal

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +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
31+
tested-with:
32+
GHC ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.4 || ==9.6.1
3233

3334
source-repository head
3435
type: git
@@ -50,10 +51,10 @@ library
5051
hs-source-dirs: src
5152
exposed-modules: Effectful.Process.Typed
5253
build-depends:
53-
, base <=4.17
54-
, bytestring
55-
, effectful-core >=1.0 && <2.3
56-
, typed-process
54+
, base >=4.14 && <5
55+
, bytestring <0.12
56+
, effectful-core >=2.0 && <2.3
57+
, typed-process >=0.2.5 && <0.3
5758

5859
test-suite typed-process-effectful-test
5960
import: language

0 commit comments

Comments
 (0)