-
Notifications
You must be signed in to change notification settings - Fork 364
303 lines (291 loc) · 9.63 KB
/
ci.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
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
name: Builds, tests & co
on: [ push, pull_request ]
env:
OPAMBSVERSION: 2.1.0-beta4
OPAMBSROOT: ~/.cache/.opam.cached
OPAM12CACHE: ~/.cache/opam1.2/cache
# This should be identical to the value in appveyor.yml
OPAM_TEST_REPO_SHA: c687553afb80373165068d67f33512b7ad39e6a3
OPAM_REPO_SHA: c687553afb80373165068d67f33512b7ad39e6a3
# Default ocaml version for some jobs
OCAML_VERSION: 4.12.0
## variables for cache paths
GH_OCAML_CACHE: ~/.cache/ocaml-local/**
SOLVER:
defaults:
run:
shell: bash
jobs:
####
# Caches
####
# ocaml-cache:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ ubuntu-latest ]
# ocamlv: [ 4.02.3, 4.03.0, 4.04.2, 4.05.0, 4.06.1, 4.07.1, 4.08.1, 4.09.1, 4.10.2, 4.11.2 ]
# include:
# - os: macos-latest
# ocamlv: 4.11.2
# fail-fast: false
# steps:
# - uses: actions/checkout@v2
# - name: ocaml ${{ matrix.ocamlv }} cache
# id: ocaml-cache
# uses: actions/cache@v2
# with:
# path: ${{ env.GH_OCAML_CACHE }}
# key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ hashFiles ('.github/scripts/ocaml-cache.sh', '.github/scripts/preamble.sh') }}
# - name: Building ocaml ${{ matrix.ocamlv }} cache
# if: steps.ocaml-cache.outputs.cache-hit != 'true'
# env:
# OCAML_VERSION: ${{ matrix.ocamlv }}
# run: bash -exu .github/scripts/ocaml-cache.sh ocaml
archives-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: src ext archives cache
id: archives
uses: actions/cache@v2
with:
path: src_ext/archives
key: archives-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile') }}
- name: Retrieve archives
if: steps.archives.outputs.cache-hit != 'true'
run: |#bash -exu .github/scripts/caches.sh archives
rm -rf src_ext/archives
export PATH=~/.cache/ocaml-local/bin:$PATH
which ocaml && export OCAML=`which ocaml` || true
make -C src_ext cache-archives
ls src_ext/archives -al
####
# Build
####
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
ocamlv: [ 4.02.3, 4.03.0, 4.04.2, 4.05.0, 4.06.1, 4.07.1, 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 4.14.0, 5.0.0~beta2 ]
include:
- os: macos-latest
ocamlv: 4.12.0
# Intentionnaly fail fast, no need to run all build if there is a
# problem in a given version; usually it is functions not defined in lower
# versions of caml
# fail-fast: false
steps:
- name: install deps
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install bubblewrap
- uses: actions/checkout@v2
- name: ocaml ${{ matrix.ocamlv }} cache
id: ocaml-cache
uses: actions/cache@v2
with:
path: ${{ env.GH_OCAML_CACHE }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ hashFiles ('.github/scripts/ocaml-cache.sh', '.github/scripts/preamble.sh') }}
- name: Building ocaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/ocaml-cache.sh ocaml
- name: Build
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/main.sh
####
# Opam tests
####
test:
needs: [ build, archives-cache ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
ocamlv: [ 4.12.0 ]
fail-fast: false
env:
OPAM_TEST: 1
steps:
- uses: actions/checkout@v2
- name: install deps - Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install bubblewrap
- name: install deps - macOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install gpatch
- name: ocaml ${{ matrix.ocamlv }} cache - test
id: ocaml-cache-test
uses: actions/cache@v2
with:
path: ${{ env.GH_OCAML_CACHE }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ hashFiles ('.github/scripts/ocaml-cache.sh', '.github/scripts/preamble.sh') }}-test
- name: Building ocaml ${{ env.OCAML_VERSION }} cache - test
if: steps.ocaml-cache-test.outputs.cache-hit != 'true'
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/ocaml-cache.sh ocaml
- name: opam bootstrap cache
id: opam-bootstrap
uses: actions/cache@v2
with:
path: |
${{ env.OPAMBSROOT }}/**
~/.cache/opam-local/bin/**
key: opam-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ hashFiles ('.github/scripts/opam-bs-cache.sh', '.github/scripts/preamble.sh') }}
- name: opam root cache
if: steps.opam-bootstrap.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/opam-bs-cache.sh
- name: opam-rt cache
id: opam-rt
uses: actions/cache@v2
with:
path: ~/.cache/opam-rt/**
key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }}
- name: Test
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/main.sh
####
# Opam cold
####
cold:
needs: [ build, archives-cache ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ ubuntu-latest, macos-latest ]
os: [ ubuntu-latest ]
ocamlv: [ 4.12.0 ]
fail-fast: false
steps:
- name: install deps
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install bubblewrap
- uses: actions/checkout@v2
- name: src ext archives cache
uses: actions/cache@v2
with:
path: src_ext/archives
key: archives-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile') }}
- name: Cold
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
OPAM_COLD: 1
run: |
make compiler
make lib-pkg
bash -exu .github/scripts/main.sh
####
# Compile solver backends
####
solvers:
needs: [ build ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
ocamlv: [ 4.12.0 ]
solver: [ z3, 0install ]
fail-fast: false
env:
SOLVER: ${{ matrix.solver }}
OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached
steps:
- uses: actions/checkout@v2
- name: install deps - Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install bubblewrap
- name: install deps - macOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install gpatch
- name: ocaml ${{ matrix.ocamlv }} cache - test
id: ocaml-cache-test
uses: actions/cache@v2
with:
path: ${{ env.GH_OCAML_CACHE }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ matrix.solver }}-${{ hashFiles ('.github/scripts/ocaml-cache.sh', '.github/scripts/preamble.sh') }}-test
- name: Building ocaml ${{ env.OCAML_VERSION }} cache - test
if: steps.ocaml-cache-test.outputs.cache-hit != 'true'
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/ocaml-cache.sh ocaml
- name: opam bootstrap cache
id: opam-bootstrap
uses: actions/cache@v2
with:
path: |
~/.cache/opam.${{ matrix.solver }}.cached
~/.cache/opam-local/bin/**
key: opam-${{ matrix.solver }}-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ hashFiles ('.github/scripts/opam-bs-cache.sh', '.github/scripts/preamble.sh') }}
- name: opam root cache
env:
OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached
if: steps.opam-bootstrap.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/opam-bs-cache.sh
- name: Compile
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/solvers.sh
####
# Upgrade from 1.2 to current
####
upgrade:
needs: [ build ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
ocamlv: [ 4.12.0 ]
fail-fast: false
steps:
- name: install deps - Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install bubblewrap
- name: install deps - macOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install gpatch
- uses: actions/checkout@v2
- name: opam 1.2 root cache
uses: actions/cache@v2
with:
path: ${{ env.OPAM12CACHE }}
key: ${{ runner.os }}-opam1.2-root
- name: ocaml ${{ matrix.ocamlv }} cache
id: ocaml-cache
uses: actions/cache@v2
with:
path: ${{ env.GH_OCAML_CACHE }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ hashFiles ('.github/scripts/ocaml-cache.sh', '.github/scripts/preamble.sh') }}
- name: Building ocaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/ocaml-cache.sh ocaml
- name: Upgrade
env:
OCAML_VERSION: ${{ matrix.ocamlv }}
OPAM_UPGRADE: 1
run: bash -exu .github/scripts/main.sh
####
# Around opam tests
###
hygiene:
needs: [ archives-cache ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: src ext archives cache
uses: actions/cache@v2
with:
path: src_ext/archives
key: archives-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile') }}
- name: Hygiene
env:
# Defined only on pull request jobs
BASE_REF_SHA: ${{ github.event.pull_request.base.sha }}
PR_REF_SHA: ${{ github.event.pull_request.head.sha }}
run: bash -exu .github/scripts/hygiene.sh