-
Notifications
You must be signed in to change notification settings - Fork 189
156 lines (129 loc) · 3.94 KB
/
haskell.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
152
153
154
155
156
name: Haskell CI
on:
push:
branches: [ 'master', 'ci' ]
pull_request:
branches: [ 'master' ]
# env:
# autoconf_ver: 2.69
jobs:
autoconf:
runs-on: ubuntu-latest
# container: ubuntu:22.10
steps:
- uses: actions/checkout@v4
- name: install autoconf
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq build-essential autoconf${{ env.autoconf_ver }}
- name: run autoreconf
run: |
autoreconf${{ env.autoconf_ver }} -fi
- uses: actions/upload-artifact@v4
with:
name: configure
path: |
configure
include/HsNetworkConfig.h.in
sdist:
runs-on: ubuntu-latest
needs: autoconf
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
cabal-version: 'latest'
- uses: actions/download-artifact@v4
with:
name: configure
- name: run sdist
run: |
cabal sdist
- uses: actions/upload-artifact@v4
with:
name: dist-tarball
path: dist-newstyle/sdist/network-*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist-newstyle/sdist/network-*
build:
runs-on: ${{ matrix.os }}
needs: autoconf
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macOS-latest', 'windows-latest' ]
ghc: [ '8.4', '9.4', '9.6', '9.8' ]
# Dependency hsc2hs does not build on Windows with GHC < 8.4
# so we test 8.4 as lowest.
# See https://github.com/haskell/hsc2hs/issues/81
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
cabal-update: true
- uses: actions/download-artifact@v4
with:
name: configure
- name: Cabal configure
run: |
cabal configure --enable-tests --disable-benchmarks --disable-documentation
- name: Cache (restore)
uses: actions/cache/restore@v4
id: cache
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-sha-${{ github.sha }}
# Append commit SHA so that new cache is always written.
# This is fine as long as we do not hit the total cache limit of 10GB.
restore-keys: |
build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-
build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-
- name: Install dependencies
run: |
cabal build --only-dependencies
- name: Cache (save)
uses: actions/cache/save@v4
if: always()
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build
run: |
cabal build all
- name: Run tests
run: |
cabal test --test-show-details=streaming
- name: Run doctest
if: ${{ runner.os == 'Linux' }}
run: |
cabal install doctest --overwrite-policy=always
cabal repl --build-depends=QuickCheck --with-ghc=doctest
- name: Cabal check
run: |
cabal check
- name: Haddock
run: |
cabal haddock --disable-documentation
# check windows can generate autoconf too
- uses: msys2/setup-msys2@v2
if: ${{ runner.os == 'Windows' }}
with:
update: true
install: autoconf
- name: Autoreconf (Windows)
if: ${{ runner.os == 'Windows' }}
shell: msys2 {0}
run: |
rm configure include/HsNetworkConfig.h.in
autoreconf -i
- name: Build (Windows)
if: ${{ runner.os == 'Windows' }}
run: |
cabal clean
cabal build --enable-tests --disable-benchmarks all