Skip to content

Commit 07c53cf

Browse files
committed
Add stack to CI and enable coveralls
1 parent 2702382 commit 07c53cf

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
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

stack.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
snapshot: lts-22.44
2+
system-ghc: true
23
packages:
34
- .
45
extra-deps:

0 commit comments

Comments
 (0)