Skip to content

Commit 6c7d7cb

Browse files
authored
Merge pull request #91 from input-output-hk/lehins/add-stack-ci
Add stack CI and enable Coveralls
2 parents 001c8dd + 07c53cf commit 6c7d7cb

File tree

3 files changed

+95
-28
lines changed

3 files changed

+95
-28
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,62 @@ jobs:
8080
8181
- name: Run fourmolu
8282
run: ./scripts/fourmolize.sh
83+
84+
test-with-stack:
85+
name: Stack
86+
runs-on: ${{ matrix.os }}
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
os: [ubuntu-latest]
91+
resolver: [lts-22, lts-23, lts-24, nightly]
92+
include:
93+
- resolver: lts-22
94+
ghc: "9.6.7"
95+
- resolver: lts-23
96+
ghc: "9.8.4"
97+
- resolver: lts-24
98+
ghc: "9.10.2"
99+
- resolver: nightly
100+
ghc: "9.12.2"
101+
env:
102+
STACK_ARGS: '--resolver ${{ matrix.resolver }} --system-ghc'
103+
cache-version: v0 # bump up this version to invalidate currently stored cache
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- uses: haskell-actions/setup@v2
108+
id: setup-haskell-cabal
109+
name: Setup Haskell
110+
with:
111+
ghc-version: ${{ matrix.ghc }}
112+
enable-stack: true
113+
stack-version: 'latest'
114+
cabal-version: 'latest'
115+
- name: Cache
116+
id: cache
117+
uses: actions/cache@v4
118+
with:
119+
path: |
120+
${{ steps.setup-haskell-cabal.outputs.stack-root }}
121+
.stack-work
122+
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
123+
restore-keys: |
124+
${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
125+
- name: Build
126+
run: |
127+
set -ex
128+
stack $STACK_ARGS test --no-run-tests --haddock --no-haddock-deps
129+
- name: Test
130+
env:
131+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
132+
run: |
133+
set -ex
134+
if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-22" ] && [ -n "${COVERALLS_REPO_TOKEN}" ]; then
135+
stack $STACK_ARGS test --coverage
136+
stack $STACK_ARGS hpc report --all
137+
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar xj shc
138+
./shc --repo-token="$COVERALLS_REPO_TOKEN" --partial-coverage --fetch-coverage combined custom
139+
else
140+
stack $STACK_ARGS test
141+
fi

cuddle.cabal

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,29 @@ library
6363
Codec.CBOR.Cuddle.Pretty.Utils
6464

6565
build-depends:
66-
base >=4.18 && <4.22,
67-
base16-bytestring ^>=1.0.2,
68-
boxes ^>=0.1.5,
69-
bytestring >=0.11.4 && <0.13,
70-
capability ^>=0.5,
71-
cborg ^>=0.2.10,
72-
containers >=0.6.7 && <0.8,
73-
data-default-class ^>=0.2,
74-
foldable1-classes-compat ^>=0.1.1,
75-
generic-optics ^>=2.2.1,
76-
hashable ^>=1.5,
77-
megaparsec ^>=9.7,
78-
mtl ^>=2.3.1,
79-
mutable-containers ^>=0.3.4,
80-
optics-core ^>=0.4.1,
81-
ordered-containers ^>=0.2.4,
82-
parser-combinators ^>=1.3,
83-
prettyprinter ^>=1.7.1,
66+
base >=4.18 && <5,
67+
base16-bytestring >=1.0.2,
68+
boxes >=0.1.5,
69+
bytestring >=0.11.4,
70+
capability >=0.5,
71+
cborg >=0.2.10,
72+
containers >=0.6.7,
73+
data-default-class >=0.2,
74+
foldable1-classes-compat >=0.1.1,
75+
generic-optics >=2.2.1,
76+
hashable >=1.4,
77+
megaparsec >=9.5,
78+
mtl >=2.3.1,
79+
mutable-containers >=0.3.4,
80+
optics-core >=0.4.1,
81+
ordered-containers >=0.2.4,
82+
parser-combinators >=1.3,
83+
prettyprinter >=1.7.1,
8484
random >=1.2,
85-
regex-tdfa ^>=1.3.2,
86-
scientific ^>=0.3.8,
87-
text >=2.0.2 && <2.2,
88-
tree-diff ^>=0.3.4,
85+
regex-tdfa >=1.3.2,
86+
scientific >=0.3.7,
87+
text >=2.0.2,
88+
tree-diff >=0.3,
8989

9090
hs-source-dirs: src
9191
default-language: GHC2021
@@ -126,7 +126,7 @@ executable cuddle
126126
cuddle,
127127
megaparsec,
128128
mtl,
129-
optparse-applicative ^>=0.19,
129+
optparse-applicative >=0.18,
130130
prettyprinter,
131131
random,
132132
text,
@@ -145,16 +145,16 @@ test-suite cuddle-test
145145
hs-source-dirs: test
146146
main-is: Main.hs
147147
build-depends:
148-
HUnit ^>=1.6.2,
149-
QuickCheck ^>=2.15,
148+
HUnit >=1.6.2,
149+
QuickCheck >=2.14,
150150
base,
151151
bytestring,
152152
cuddle,
153153
data-default-class,
154-
hspec ^>=2.11,
155-
hspec-megaparsec ^>=2.2,
154+
hspec >=2.11,
155+
hspec-megaparsec >=2.2,
156156
megaparsec,
157157
prettyprinter,
158-
string-qq ^>=0.0.6,
158+
string-qq >=0.0.6,
159159
text,
160160
tree-diff,

stack.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
snapshot: lts-22.44
2+
system-ghc: true
3+
packages:
4+
- .
5+
extra-deps:
6+
- capability-0.5.0.1@sha256:3b3fa095891573bbdff854bf8351c3fcfa986d502c8071a2e4a2686ff3819302,3287
7+
- data-default-class-0.2.0.0@sha256:788dc5c0be3981ca83ad11206e300a77ae8a1c8b9bc4f9630f563d37f540ccbd,728
8+
- data-default-0.8.0.1@sha256:536ff91641a39b8ad302eebceff767d86ec6b543b44b1db9104650a2b1bc63bd,1110

0 commit comments

Comments
 (0)