Repository navigation
148 lines (126 loc) · 4.56 KB
/
Copy pathhaskell.yml
File metadata and controls
148 lines (126 loc) · 4.56 KB
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
name: Haskell CI
on:
push:
branches: [ 'master', 'ci' ]
pull_request:
branches: [ 'master' ]
# A newer push supersedes a run still in progress, except on master, which is
# where the cache is written.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
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
build:
runs-on: ${{ matrix.os }}
needs: autoconf
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macOS-latest', 'windows-latest' ]
ghc: [ '9.4', '9.6', '9.8', '9.10', '9.12', '9.14' ]
# GitHub runs at most five macOS jobs at once. What is OS-specific
# here does not vary by compiler, so keep the oldest and newest off
# Linux and let Linux cover the range in between.
exclude:
- { os: macOS-latest, ghc: '9.6' }
- { os: macOS-latest, ghc: '9.8' }
- { os: macOS-latest, ghc: '9.10' }
- { os: macOS-latest, ghc: '9.12' }
- { os: windows-latest, ghc: '9.6' }
- { os: windows-latest, ghc: '9.8' }
- { os: windows-latest, ghc: '9.10' }
- { os: windows-latest, ghc: '9.12' }
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
cabal-update: true
# The macOS image selects Xcode 26.6, whose ld cannot read the SDK 27
# stubs that clang picks up from the Command Line Tools. The Command
# Line Tools' own ld can, so link with them.
- name: Link with the Command Line Tools
if: ${{ runner.os == 'macOS' }}
run: sudo xcode-select -s /Library/Developer/CommandLineTools
- 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
# Only from master: a cache written on a branch is visible to that branch
# alone, and every PR writing one crowds out master's under the cap.
- name: Cache (save)
uses: actions/cache/save@v4
if: ${{ !cancelled() && github.event_name == 'push' && github.ref_name == 'master' }}
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