-
Notifications
You must be signed in to change notification settings - Fork 362
603 lines (586 loc) · 20.8 KB
/
main.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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
name: Builds, tests & co
on:
pull_request:
paths:
- 'src/**'
- '!src/tools/**'
- 'src_ext/**'
- 'dune'
- 'dune-project'
- '*.opam'
- 'Makefile*'
- 'configure*'
- '.github/scripts/**'
- '.github/workflows/main.yml'
- 'tests/**'
- '!tests/bench/**'
- 'shell/'
push:
branches:
- 'master'
- '2.**'
env:
OPAMBSVERSION: 2.1.0
OPAMBSROOT: ~/.cache/.opam.cached
OPAM12CACHE: ~/.cache/opam1.2/cache
OPAM_REPO: https://github.com/ocaml/opam-repository.git
OPAM_TEST_REPO_SHA: dff745994c64d083a6ba3ddc5a9c28ed0ad0f40a
OPAM_REPO_SHA: 6eee105e52e098e36949a584c053a18bcb9b2f6b
SOLVER:
CYGWIN_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
CYGWIN_ROOT: D:\cygwin
CYGWIN: winsymlinks:native
CYGWIN_EPOCH: 3
defaults:
run:
shell: bash
jobs:
####
# Caches
####
Analyse:
runs-on: ubuntu-latest
outputs:
archives: ${{ steps.keys.outputs.archives }}
ocaml-cache: ${{ steps.keys.outputs.ocaml-cache }}
cygwin: ${{ steps.keys.outputs.cygwin }}
opam-bs-cache: ${{ steps.keys.outputs.opam-bs-cache }}
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: Determine cache keys
id: keys
run: |
echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}
echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT
echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }}
echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} >> $GITHUB_OUTPUT
echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }}
echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} >> $GITHUB_OUTPUT
echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }}
echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }} >> $GITHUB_OUTPUT
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ steps.keys.outputs.archives }}
lookup-only: true
enableCrossOsArchive: true
- name: Create src_ext/archives and opam-repository cache
if: steps.archives.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/archives-cache.sh
Cygwin:
runs-on: windows-2019
needs: Analyse
steps:
- name: Cygwin64 Cache
id: cygwin64
uses: actions/cache@v4
with:
path: D:\Cache\cygwin\x86_64-pc-cygwin
key: cygwin64-${{ needs.Analyse.outputs.cygwin }}
lookup-only: true
enableCrossOsArchive: true
- name: Checkout tree
if: steps.cygwin64.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Create Cygwin64 cache
if: steps.cygwin64.outputs.cache-hit != 'true'
shell: cmd
run: .github\scripts\cygwin.cmd x86_64-pc-cygwin D:\Cache\cygwin create
####
# Build
####
Build-Linux:
runs-on: ubuntu-latest
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 4.14.1 ]
fail-fast: true
steps:
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: Build
run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu
- name: Test (basic)
run: bash -exu .github/scripts/main/test.sh
Build-Windows:
runs-on: windows-2019
needs: [ Analyse, Cygwin ]
strategy:
matrix:
host: [ x86_64-pc-cygwin, i686-w64-mingw32, x86_64-w64-mingw32, i686-pc-windows, x86_64-pc-windows ]
build: [ x86_64-pc-cygwin ]
ocamlv: [ 4.14.1 ]
fail-fast: false
defaults:
run:
shell: D:\cygwin\bin\bash.exe {0}
steps:
- name: Configure LF checkout for Cygwin
if: endsWith(matrix.host, '-pc-cygwin')
shell: cmd
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- name: Checkout tree
uses: actions/checkout@v4
- name: Cygwin64 Cache
id: cygwin64
if: matrix.build == 'x86_64-pc-cygwin'
uses: actions/cache@v4
with:
path: D:\Cache\cygwin\x86_64-pc-cygwin
key: cygwin64-${{ needs.Analyse.outputs.cygwin }}
enableCrossOsArchive: true
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: D:\Cache\ocaml-local.tar
key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
enableCrossOsArchive: true
- name: Unpack Cygwin
shell: cmd
run: .github\scripts\cygwin.cmd ${{ matrix.build }} D:\Cache\cygwin ${{ matrix.host }}
- name: Unpack OCaml ${{ matrix.ocamlv }}
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} ${{ matrix.host }}
- name: Build
run: bash -exu .github/scripts/main/main.sh ${{ matrix.host }}
- name: Test "static" binaries on Windows
if: endsWith(matrix.host, '-pc-cygwin') == false
run: ldd ./opam.exe | test "$(grep -v -F /cygdrive/c/Windows/)" = ''
- name: Upload opam binaries for Windows
if: endsWith(matrix.host, '-pc-windows')
uses: actions/upload-artifact@v4
with:
name: opam-exe-${{ matrix.host }}-${{ matrix.ocamlv }}-${{ matrix.build }}
path: |
D:\Local\bin\opam.exe
D:\Local\bin\opam-installer.exe
D:\Local\bin\opam-putenv.exe
- name: Test (basic - Cygwin)
if: endsWith(matrix.host, '-pc-cygwin')
run: bash -exu .github/scripts/main/test.sh
- name: Test (basic - native Windows)
env:
OPAMROOT: D:\a\opam\opam\.opam
if: endsWith(matrix.host, '-pc-cygwin') == false
shell: cmd
run: |
set Path=D:\Cache\ocaml-local\bin;%Path%
if "${{ matrix.host }}" equ "x86_64-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
if "${{ matrix.host }}" equ "i686-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
opam init --yes --bare default git+file://D:/opam-repository#${{ env.OPAM_TEST_REPO_SHA }} --no-git-location || exit /b 1
opam switch --yes create default ocaml-system || exit /b 1
opam env || exit /b 1
opam install --yes lwt || exit /b 1
opam list || exit /b 1
opam config report || exit /b 1
- name: Test (reftests)
run: bash -exu .github/scripts/main/reftests.sh ${{ matrix.host }}
Build-macOS:
runs-on: macos-latest
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.14.1 ]
fail-fast: true
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: Build
run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin
- name: Test (basic)
run: bash -exu .github/scripts/main/test.sh
####
# Opam tests
####
Test-Linux:
runs-on: ubuntu-latest
needs: [ Analyse, Build-Linux ]
strategy:
matrix:
ocamlv: [ 4.14.1 ]
fail-fast: false
env:
OPAM_TEST: 1
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: opam bootstrap Cache
id: opam-bootstrap
uses: actions/cache@v4
with:
path: |
${{ env.OPAMBSROOT }}/**
~/.cache/opam-local/bin/**
key: opam-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }}
- name: Create opam bootstrap cache
if: steps.opam-bootstrap.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/opam-bs-cache.sh
- name: opam-rt Cache
id: opam-rt
uses: actions/cache@v4
with:
path: ~/.cache/opam-rt/**
key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }}
- name: Build (and test)
run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu
- name: Test (opam-rt)
run: bash -exu .github/scripts/main/opam-rt.sh
Test-macOS:
runs-on: macos-latest
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.14.1 ]
fail-fast: false
env:
OPAM_TEST: 1
steps:
- name: Install gnu coreutils
run: brew install coreutils gpatch
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: opam bootstrap Cache
id: opam-bootstrap
uses: actions/cache@v4
with:
path: |
${{ env.OPAMBSROOT }}/**
~/.cache/opam-local/bin/**
key: opam-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }}
- name: Create opam bootstrap cache
if: steps.opam-bootstrap.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/opam-bs-cache.sh
- name: opam-rt Cache
id: opam-rt
uses: actions/cache@v4
with:
path: ~/.cache/opam-rt/**
key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }}
- name: Build (and test)
run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin
- name: Test (opam-rt)
run: bash -exu .github/scripts/main/opam-rt.sh
####
# Opam cold
####
Cold-Linux:
runs-on: ubuntu-latest
needs: [ Analyse, Build-Linux ]
env:
OPAM_COLD: 1
steps:
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: Cold
run: |
make compiler
bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu
- name: Test (basic)
run: bash -exu .github/scripts/main/test.sh
####
# Compile solver backends
####
Solvers-Linux:
runs-on: ubuntu-latest
needs: [ Analyse, Build-Linux ]
strategy:
matrix:
solver: [ z3, 0install ]
ocamlv: [ 4.14.1 ]
fail-fast: false
env:
SOLVER: ${{ matrix.solver }}
OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached
steps:
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: opam bootstrap Cache
id: opam-bootstrap
uses: actions/cache@v4
with:
path: |
${{ env.OPAMBSROOT }}/**
~/.cache/opam-local/bin/**
key: opam-${{ matrix.solver }}-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }}
- name: Create opam bootstrap cache
if: steps.opam-bootstrap.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/opam-bs-cache.sh
- name: Compile
run: bash -exu .github/scripts/main/solvers.sh
Solvers-macOS:
runs-on: macos-latest
needs: [ Analyse, Build-macOS ]
strategy:
matrix:
solver: [ z3, 0install ]
ocamlv: [ 4.14.1 ]
fail-fast: false
env:
SOLVER: ${{ matrix.solver }}
OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: opam bootstrap Cache
id: opam-bootstrap
uses: actions/cache@v4
with:
path: |
${{ env.OPAMBSROOT }}/**
~/.cache/opam-local/bin/**
key: opam-${{ matrix.solver }}-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }}
- name: Create opam bootstrap cache
if: steps.opam-bootstrap.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/opam-bs-cache.sh
- name: Compile
run: bash -exu .github/scripts/main/solvers.sh
####
# Upgrade from 1.2 to current
####
Upgrade-Linux:
runs-on: ubuntu-latest
needs: [ Analyse, Build-Linux ]
strategy:
matrix:
ocamlv: [ 4.14.1 ]
fail-fast: false
steps:
- name: Install bubblewrap
run: sudo apt install bubblewrap
- name: Checkout tree
uses: actions/checkout@v4
- name: opam 1.2 root Cache
uses: actions/cache@v4
with:
path: ${{ env.OPAM12CACHE }}
key: ${{ runner.os }}-opam1.2-root
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: Build
env:
OPAM_UPGRADE: 1
run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu
- name: Test (upgrade)
run: bash -exu .github/scripts/main/upgrade.sh
Upgrade-macOS:
runs-on: macos-latest
needs: [ Analyse, Build-macOS ]
strategy:
matrix:
ocamlv: [ 4.14.1 ]
fail-fast: false
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: opam 1.2 root Cache
uses: actions/cache@v4
with:
path: ${{ env.OPAM12CACHE }}
key: ${{ runner.os }}-opam1.2-root
- name: OCaml ${{ matrix.ocamlv }} Cache
id: ocaml-cache
uses: actions/cache@v4
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
- name: Create OCaml ${{ matrix.ocamlv }} cache
if: steps.ocaml-cache.outputs.cache-hit != 'true'
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}
- name: Build
env:
OPAM_UPGRADE: 1
run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin
- name: Test (upgrade)
run: bash -exu .github/scripts/main/upgrade.sh
####
# Around opam tests
####
Hygiene:
runs-on: ubuntu-22.04
needs: Analyse
steps:
- name: Install system's dune and ocaml packages
run: sudo apt install dune ocaml
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
id: archives
uses: actions/cache@v4
with:
path: |
src_ext/archives
~/opam-repository
key: ${{ needs.Analyse.outputs.archives }}
enableCrossOsArchive: true
- name: Get changed files
id: files
uses: Ana06/get-changed-files@v2.2.0
- name: Changed files list
run: |
for changed_file in ${{ steps.files.outputs.modified }}; do
echo "M ${changed_file}."
done
for changed_file in ${{ steps.files.outputs.removed }}; do
echo "D ${changed_file}."
done
for changed_file in ${{ steps.files.outputs.added }}; do
echo "A ${changed_file}."
done
for changed_file in ${{ steps.files.outputs.renamed }}; do
echo "AD ${changed_file}."
done
- name: Hygiene
env:
BASE_REF_SHA: ${{ github.event.pull_request.base.sha }}
PR_REF_SHA: ${{ github.event.pull_request.head.sha }}
if: contains(steps.files.outputs.modified, 'configure.ac') || contains(steps.files.outputs.all, 'src_ext') || contains(steps.files.outputs.all, '.github/workflows')
run: bash -exu .github/scripts/main/hygiene.sh