-
Notifications
You must be signed in to change notification settings - Fork 6
201 lines (174 loc) · 6.89 KB
/
haskell.yml
File metadata and controls
201 lines (174 loc) · 6.89 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Haskell CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: ${{ matrix.name }}
env:
# ------------------------------------------------------------------------
# Common options
# ------------------------------------------------------------------------
CABAL_REINIT_CONFIG: y
LC_ALL: C.UTF-8
DISABLE_TEST: n
# ------------------------------------------------------------------------
# cabal options
# ------------------------------------------------------------------------
CABAL_CHECK_RELAX: y
CABAL_NO_SANDBOX: y
CABAL_HACKAGE_MIRROR: "hackage.haskell.org:http://hackage.fpcomplete.com"
# ------------------------------------------------------------------------
# Location of packcheck.sh
# ------------------------------------------------------------------------
PACKCHECK_LOCAL_PATH: "./packcheck.sh"
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
PACKCHECK_GITHUB_COMMIT: "v0.6.0"
# ------------------------------------------------------------------------
# Build options
# ------------------------------------------------------------------------
BUILD: cabal-v2 ${{ matrix.pack_options }}
GHCVER: ${{ matrix.ghc_version }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
name:
- 8.0.2
- 8.2.2
- 8.4.4
- 8.6.5
- 8.8.4
- 8.8.4+macOS+exe
- 8.10.7+exe
- 9.0.2
- 9.2.5+exe
- 9.4.4
- 9.6.0
- head
- hlint
include:
- name: 8.0.2
ghc_version: 8.0.2
runner: ubuntu-latest
cabal_version: 3.2
pack_options: DISABLE_TEST=y
- name: 8.2.2
ghc_version: 8.2.2
runner: ubuntu-latest
cabal_version: 3.2
pack_options: DISABLE_TEST=y
- name: 8.4.4
ghc_version: 8.4.4
runner: ubuntu-latest
cabal_version: 3.2
pack_options: DISABLE_TEST=y
- name: 8.6.5
ghc_version: 8.6.5
runner: ubuntu-latest
cabal_version: 3.2
- name: 8.8.4
ghc_version: 8.8.4
runner: ubuntu-latest
cabal_version: 3.2
- name: 8.8.4+macOS+exe
ghc_version: 8.8.4
pack_options: CABAL_BUILD_OPTIONS="-f ucd2haskell"
runner: macos-latest
cabal_version: 3.2
- name: 8.10.7+exe
ghc_version: 8.10.7
pack_options: CABAL_BUILD_OPTIONS="-f ucd2haskell"
runner: ubuntu-latest
cabal_version: 3.2
- name: 9.0.2
ghc_version: 9.0.2
runner: ubuntu-latest
cabal_version: 3.2
# [NOTE] GHC > 9.2 cannot build ucd2haskell
- name: 9.2.5+exe
ghc_version: 9.2.5
pack_options: CABAL_BUILD_OPTIONS="-f ucd2haskell"
runner: ubuntu-latest
cabal_version: 3.6
- name: 9.4.4
ghc_version: 9.4.4
runner: ubuntu-latest
cabal_version: 3.8.1.0
# [TODO] Once GHC 9.6.1 is published and supported by ghcup:
# • Remove release channel
# • Set GHC version to 9.6.1
# • Set Cabal version to 3.10
- name: 9.6.0
ghc_version: 9.6.0.20230128
ghcup_release_channel: "https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml"
runner: ubuntu-latest
cabal_version: 3.9.0.0
- name: head
ghc_version: head
ghcup_release_channel: "https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml"
runner: ubuntu-latest
# [WARNING] Ensure to use latest cabal (pre-)release
cabal_version: 3.9.0.0
- name: hlint
pack_options: HLINT_OPTIONS="lint" HLINT_TARGETS="lib exe"
runner: ubuntu-latest
cabal_version: 3.2
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
if: ${{ matrix.ghc_version != 'head' }}
with:
ghc-version: ${{ matrix.ghc_version }}
ghcup-release-channel: ${{ matrix.ghcup_release_channel }}
cabal-version: ${{ matrix.cabal_version }}
# [TODO] Use haskell/actions/setup when it supports reliably GHC head.
# Adapted from https://github.com/composewell/streamly/blob/master/.github/workflows/haskell.yml
- name: Install GHC head environment
if: ${{ matrix.ghc_version == 'head' }}
run: |
# Install ghcup
CURL=$(which curl)
os=$(uname -s -m)
case "$os" in
"Linux x86_64") GHCUP_ARCH="x86_64-linux" ;;
"Darwin x86_64") GHCUP_ARCH="x86_64-apple-darwin" ;;
*) echo "Unknown OS/Arch: $os"; exit 1;;
esac
# Check available versions here: https://downloads.haskell.org/~ghcup/
GHCUP_VER=0.1.19.0
$CURL -sL -o ./ghcup https://downloads.haskell.org/~ghcup/$GHCUP_VER/${GHCUP_ARCH}-ghcup-$GHCUP_VER
chmod +x ./ghcup
# Set ghcup pre-release
./ghcup config add-release-channel ${{ matrix.ghcup_release_channel }}
# Install GHC head
# The URL may change, to find a working URL go to https://gitlab.haskell.org/ghc/ghc/-/jobs/
# Find a debian10 job, click on a passed/failed job, at the
# end of the output you will find the tar.xz name, put that after
# "raw/", and put the job name after "job=".
# Also see https://github.com/mpickering/ghc-artefact-nix/blob/master/gitlab-artifact.nix
./ghcup install ghc -u https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-linux-deb10-int_native-validate.tar.xz?job=x86_64-linux-deb10-int_native-validate head
./ghcup set ghc ${{ matrix.ghc_version }}
# Install cabal
./ghcup install cabal ${{ matrix.cabal_version }}
./ghcup set cabal ${{ matrix.cabal_version }}
- uses: actions/cache@v3
name: Cache ~/.cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal
- name: Download packcheck
run: |
# If a custom stack-yaml is specified, replace the default with that
if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
unset STACK_YAML
# Get packcheck if needed
CURL=$(which curl)
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
chmod +x $PACKCHECK_LOCAL_PATH
- name: Run packcheck
run: |
bash -c "$PACKCHECK_LOCAL_PATH $BUILD"