-
Notifications
You must be signed in to change notification settings - Fork 8
151 lines (128 loc) · 4.16 KB
/
build.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Builds and tests this Haskell project on "GitHub Actions"
#
# 2021-2024 Rudy Matela
#
# some docs: https://github.com/haskell-actions/setup
#
# The official haskell docker image: https://hub.docker.com/_/haskell
name: build
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Cache ~/.cabal/packages
uses: actions/cache@v3
with:
path: ~/.cabal/packages
key: v1-${{ runner.os }}-cabal-packages-${{ hashFiles('*.cabal') }}
restore-keys: v1-${{ runner.os }}-cabal-packages-
- name: Cache ~/.cabal and ~/.ghc
uses: actions/cache@v3
with:
path: |
~/.cabal
!~/.cabal/packages
~/.ghc
key: v1-${{ runner.os }}-cabal-ghc-latest-${{ hashFiles('*.cabal') }}
restore-keys: v1-${{ runner.os }}-cabal-ghc-latest-
- run: du -hd3 ~/.cabal ~/.ghc || true
- run: make --version
- run: haddock --version || sudo apt-get install ghc-haddock
- run: ghc --version
- run: cabal --version
- run: haddock --version
- run: ghc-pkg list
- name: Check out repository
uses: actions/checkout@v3
- run: git --version
- run: make install-dependencies
# 2023-07: some projects were failing with missing base for GHC 9.6.
# Here we compile through cabal only provisionally.
# - run: make
# - run: make test
# - run: make haddock
- run: make test-sdist
#- run: make test-via-cabal
- run: cabal configure --enable-tests --enable-benchmarks --ghc-options="-O0"
- run: cabal update # latest version of cabal requires a package list to run...
- run: cabal build
- run: cabal test
- run: cabal haddock
test-with-ghc:
strategy:
matrix:
ghc:
- '9.8'
- '9.6'
- '9.4'
- '9.2'
- '9.0'
- '8.10'
- '8.8'
- '8.6'
- '8.4'
- '8.2'
- '7.10'
runs-on: ubuntu-latest
needs: build-and-test
container: haskell:${{ matrix.ghc }}
steps:
- name: Cache ~/.cabal/packages
uses: actions/cache@v3
with:
path: ~/.cabal/packages
key: v1-${{ runner.os }}-cabal-packages-${{ hashFiles('*.cabal') }}
restore-keys: v1-${{ runner.os }}-cabal-packages-
- name: Cache ~/.cabal and ~/.ghc
uses: actions/cache@v3
with:
path: |
~/.cabal
!~/.cabal/packages
~/.ghc
key: v1-${{ runner.os }}-cabal-ghc-${{ matrix.ghc }}-${{ hashFiles('*.cabal') }}
restore-keys: v1-${{ runner.os }}-cabal-ghc-${{ matrix.ghc }}-
- run: du -hd3 ~/.cabal ~/.ghc || true
- run: make --version || rm /etc/apt/sources.list.d/*.list # faster update
- run: make --version || apt-get update
- run: make --version || apt-get install make
- run: ghc --version
- run: cabal --version
- run: haddock --version
- run: ghc-pkg list
- name: Check out repository
uses: actions/checkout@v3
- run: make install-dependencies
- run: make
- run: make test
- run: make haddock
- run: make test-sdist
- run: make test-via-cabal
test-with-stack:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Setup Haskell's GHC and Cabal as required by current Stackage LTS
uses: haskell-actions/setup@v2
with: # lts-19.19
ghc-version: '9.0.2'
cabal-version: '3.4'
- uses: actions/cache@v3
with:
path: ~/.stack
key: v1-${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}
restore-keys: v1-${{ runner.os }}-stack-
- run: stack --version
- name: Check out repository
uses: actions/checkout@v3
- run: make test-via-stack
test-with-hugs:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- run: sudo apt-get update
- run: sudo apt-get install hugs
- name: Check out repository
uses: actions/checkout@v3
- run: make hugs-test