-
Notifications
You must be signed in to change notification settings - Fork 189
129 lines (108 loc) · 3.02 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
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@v3
- name: install autoconf
run: |
apt-get update -y -qq
apt-get install -y -qq build-essential autoconf${{ env.autoconf_ver }}
- name: run autoreconf
run: |
autoreconf${{ env.autoconf_ver }} -fi
- uses: actions/upload-artifact@v3
with:
name: configure
path: |
configure
include/HsNetworkConfig.h.in
sdist:
runs-on: ubuntu-latest
needs: autoconf
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
cabal-version: '3.4'
- uses: actions/download-artifact@v3
with:
name: configure
- name: run sdist
run: |
cabal sdist
- uses: actions/upload-artifact@v3
with:
name: dist-tarball
path: dist-newstyle/sdist/network-*
- name: Release
uses: softprops/action-gh-release@v1
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.10', '9.0', '9.2' ]
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.8'
- uses: actions/download-artifact@v3
with:
name: configure
- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --disable-benchmarks
- name: Build
run: cabal build --enable-tests --disable-benchmarks 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
# check windows can generate autoconf too
- uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
update: true
install: autoconf
- if: matrix.os == 'windows-latest'
name: autoreconf
shell: msys2 {0}
run: |
rm configure include/HsNetworkConfig.h.in
autoreconf -i
- if: matrix.os == 'windows-latest'
name: Build
run: |
cabal clean
cabal build --enable-tests --disable-benchmarks all