-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (87 loc) · 2.42 KB
/
haskell-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
cabal:
name: cabal ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
cabal:
- "3.10"
ghc:
- 9.0.2
- 9.2.8
- 9.4.8
- 9.6.4
- 9.8.2
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Haskell Cabal
uses: haskell/actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v3
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
- name: Build
run: cabal build --enable-tests --enable-benchmarks --write-ghc-environment-files=always
- name: Test
run: cabal test --enable-tests
stack:
name: ${{ matrix.os }} / ${{ matrix.stack-yaml }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
stack:
- 2.15.5
stack-yaml:
- stack-9.0.2.yaml
- stack-9.2.8.yaml
- stack-9.4.8.yaml
- stack-9.6.4.yaml
- stack-9.8.2.yaml
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: haskell/actions/setup@v2
name: Setup Haskell Stack
with:
stack-version: ${{ matrix.stack }}
- uses: actions/cache@v4
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.stack-yaml }}
- name: Install dependencies
run: stack build --stack-yaml ${{ matrix.stack-yaml }} --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
- name: Build
run: stack build --stack-yaml ${{ matrix.stack-yaml }} --test --bench --no-run-tests --no-run-benchmarks
- name: Test
run: stack test --stack-yaml ${{ matrix.stack-yaml }}