-
Notifications
You must be signed in to change notification settings - Fork 232
760 lines (643 loc) · 21.2 KB
/
check-world.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
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
name: Check world (build F* and all projects)
# This workflow builds/checks F* and a selection of subprojects
# depending on it.
#
# It is meant to test if an F* patch impacts other projects heavily or
# not. Jobs can (and will) run in parallel if the dependencies allow,
# using (mostly) Github hosted runners which are small-ish 4 core VMs.
#
# The steps are containerized and running on a docker container
# 'mtzguido/fstar-base-testing` built from .docker/nu_base.Dockerfile
# (FIXME: it needs a big cleanup and should go into an FStarLang
# namespace)
#
# Self-hosted runners *can* be used, and it's desirable to do it for
# things like HACL* or everparse that take really long on Github VMs
# (build-hacl takes ~1h50m on github runners, ~20m on a new-ish 16-core
# 32-thread desktop). HOWEVER, Github actions seems to be incredibly
# stupid in bind mounting the workspace for the job from the current
# directory of the runner, which means the workspace has the UID of the
# user that started the runner, but the steps of the job run inside the
# runner with the UID of the docker user. If these UIDs differ, the job
# will quickly fail to do anything and break. I'm not sure what the
# canonical fix is here, I think this is insane. FIXME
#
# We also use some custom actions. They are all not very well documented
# and not robust, so think twice (or ask) before using elsewhere!
# - mtzguido/set-opam-env:
# this sets up the opam environment for the following steps
# (`eval $(opam env)` will not cut it, nor will `opam env >> $GITHUB_ENV`)
#
# - mtzguido/gci-upload:
# this uploads an artifact, much like github/upload-artifact, but first
# packages it up into a tarball to preserve permissions (like exec bits).
# Again it's insane that github does not do this by default. The tarball
# will anyways be zipped afterwards since all github artifacts are zipped,
# and will show up in the workflow run page.
# It takes an optional 'extra' for argments to tar, that we use to ignore
# some directories. It also ignores .git by default.
# The 'hometag' is a way to set home variables when downloading the artifacts.
#
# - mtzguido/gci-download:
# The companion to gci-upload. It will download the zipped tarball, unzip,
# and extract into a directory named like the artifact. If the gci-upload had
# a 'hometag: FOO', then the client downloading the artifact will get FOO_HOME
# set in the environment, equal to the directory where the artifact was extracted.
# This means most jobs do
#
# - uses: mtzguido/gci-download@master
# with:
# name: FStar
#
# And get a working F* with FSTAR_HOME set in the FStar directory.
#
#
# Adding new jobs should be relatively easy. Just state dependencies in
# the 'needs', and start the job by fetching the required dependencies
# with gci-download, and then build. The examples below should serve
# as a guide. If possible, separate the building from the testing,
# since future jobs may need the built resource, but all tests are
# independent. (However note that there is an overhead to start a job,
# it's ~40s alone to start a container, so don't overdo it by splitting
# up too much).
on:
# push:
workflow_dispatch:
workflow_call:
# TODO:
# Is there a way to set the default container?
# Move to the regular fstar-ci-base too
defaults:
run:
shell: bash
jobs:
build-fstar:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- name: Checkout
uses: actions/checkout@master
with:
path: FStar/
- name: Prep
run: |
# In case we edited fstar.opam, install new deps here
# This will most likely fail to like krml below, what's going on?
# opam install --confirm-level=unsafe-yes --deps-only ./FStar/fstar.opam
- name: Build
run: make -C FStar -skj$(nproc)
- uses: mtzguido/gci-upload@master
with:
name: FStar
extra: --exclude=FStar/ocaml/_build
hometag: FSTAR
test-fstar:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs: build-fstar
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- name: Test
run: make -C FStar -skj$(nproc) ci-uregressions
test-fstar-boot:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
# needs: build-fstar
# ^ This does not really depend on the previous job, but this can be
# enabled if we wanted to sequentialize them for whatever reason.
# We start from scratch since we need a git repo to check the
# diff, and that is not contained in the artifact. We could just
# take the ulib checked files from the artifact, if we really wanted
# to, but checking ulib with ADMIT is quite fast anyway.
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: actions/checkout@master
with:
path: FStar/
- name: Bootstrap
run: |
make -C FStar -skj$(nproc) 1
make -C FStar -skj$(nproc) full-bootstrap ADMIT=1
- name: Check diff
run: |
cd FStar/
./.scripts/check-snapshot-diff.sh
- uses: mtzguido/gci-upload@master
with:
name: FStar-boot
path: FStar
extra: --exclude=FStar/ocaml/_build
hometag: FSTAR
build-krml:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs: build-fstar
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- name: Checkout karamel
uses: actions/checkout@master
with:
path: karamel/
repository: FStarLang/karamel
- name: Prep
run: |
# Fails mysteriously:
#
# Error: Package conflict!
# * No agreement on the version of ocaml:
# - (invariant) -> ocaml-base-compiler = 4.14.2 -> ocaml = 4.14.2
# No solution found, exiting
# - karamel -> fstar -> ocaml < 4.06.0
# You can temporarily relax the switch invariant with `--update-invariant'
# * No agreement on the version of ocaml-base-compiler:
# - (invariant) -> ocaml-base-compiler = 4.14.2
# - karamel -> fstar -> ocaml < 4.06.0 -> ocaml-base-compiler = 3.07+1
# * Missing dependency:
# - karamel -> fstar -> z3 = 4.8.5 -> conf-python-2-7
# depends on the unavailable system package 'python2.7'. Use `--no-depexts' to attempt installation anyway, or it is possible that a depext package name in the opam file is incorrect.
# * Missing dependency:
# - karamel -> fstar -> ocaml < 4.06.0 -> ocaml-variants >= 3.11.1 -> ocaml-beta
# unmet availability conditions: 'enable-ocaml-beta-repository'
# * Missing dependency:
# - karamel -> fstar -> ocaml < 4.06.0 -> ocaml-variants >= 3.11.1 -> system-msvc
# unmet availability conditions: 'os = "win32"'
#
# opam install --confirm-level=unsafe-yes --deps-only ./karamel/karamel.opam
- name: Build krml
run: make -C karamel -skj$(nproc)
# krml is a symlink to _build/default/src/Karamel.exe, but we want to exclude _build.
# So, overwrite the link with the actual file.
- name: Fix for symlink
run: |
cp --remove-destination $(realpath karamel/krml) karamel/krml
- uses: mtzguido/gci-upload@master
with:
name: karamel
extra: --exclude=karamel/_build
hometag: KRML
test-krml:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- name: Test
run: make -C karamel -skj$(nproc) test
build-steel:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- name: Checkout steel
uses: actions/checkout@master
with:
path: steel/
repository: FStarLang/steel
- name: Build
run: make -C steel -skj$(nproc)
- uses: mtzguido/gci-upload@master
with:
name: steel
hometag: STEEL
test-steel:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-steel
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: steel
- name: Test
run: make -C steel -skj$(nproc) test
build-pulse:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- name: Checkout pulse
uses: actions/checkout@master
with:
path: pulse/
repository: FStarLang/pulse
- name: Build
run: make -C pulse -skj$(nproc)
- uses: mtzguido/gci-upload@master
with:
name: pulse
hometag: PULSE
test-pulse-boot:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- test-fstar-boot
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar-boot
- name: Checkout pulse
uses: actions/checkout@master
with:
path: pulse/
repository: FStarLang/pulse
- name: Build
run: |
# This is similar for 'make full-boot', but does not
# check the library.
make -C pulse/src -skj$(nproc) clean-snapshot
make -C pulse/src -skj$(nproc) extract
make -C pulse/src -skj$(nproc) build-ocaml
- name: Check diff
run: |
cd pulse/
./.scripts/check-snapshot-diff.sh
test-pulse:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-pulse
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: pulse
- name: Test
run: make -C pulse -skj$(nproc) test
build-hacl:
# runs-on: [self-hosted, linux, big] # using a faster runner
# NOTE: To use a self-hosted runner, we must make sure that
# the runner is executing as UID 1001 (which is the one the
# docker container uses) or it will be unable to write to its
# workspace. This is simply a terrible design by github actions.
# Somehow the cloud runners work regardless of the uid in
# the container.
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- name: Checkout hacl-star
uses: actions/checkout@master
with:
path: hacl-star/
repository: hacl-star/hacl-star
- run: echo "HACL_HOME=$(pwd)/hacl-star" >> $GITHUB_ENV
- name: Get Vale
run: ./hacl-star/tools/get_vale.sh
- name: Build
run: |
NPROC=$(nproc)
if [ $NPROC -gt 16 ]; then NPROC=16; fi
make -C hacl-star -skj${NPROC}
- uses: mtzguido/gci-upload@master
with:
name: hacl-star
hometag: HACL
test-hacl:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-hacl
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: hacl-star
- name: Get Vale (again)
run: ./hacl-star/tools/get_vale.sh
- name: Test
run: make -C hacl-star -skj$(nproc) test
build-everparse:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- name: Checkout everparse
uses: actions/checkout@master
with:
path: everparse/
repository: project-everest/everparse
- name: Build
run: |
NPROC=$(nproc)
if [ $NPROC -gt 16 ]; then NPROC=16; fi
make -C everparse -skj${NPROC}
- uses: mtzguido/gci-upload@master
with:
name: everparse
hometag: EVERPARSE
test-everparse:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-everparse
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: everparse
- name: Test
run: make -C everparse -skj$(nproc) test
build-merkle-tree:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-hacl
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: hacl-star
- name: Checkout merkle-tree
uses: actions/checkout@master
with:
path: merkle-tree/
repository: hacl-star/merkle-tree
- name: Build
run: |
NPROC=$(nproc)
if [ $NPROC -gt 16 ]; then NPROC=16; fi
make -C merkle-tree -skj${NPROC} dist/libmerkletree.a
- uses: mtzguido/gci-upload@master
with:
name: merkle-tree
test-merkle-tree:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-hacl
- build-merkle-tree
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: hacl-star
- uses: mtzguido/gci-download@master
with:
name: merkle-tree
- name: Test
run: make -C merkle-tree -skj$(nproc) test
build-mitls-fstar:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-hacl
- build-everparse
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: everparse
- uses: mtzguido/gci-download@master
with:
name: hacl-star
- name: Checkout mitls-fstar
uses: actions/checkout@master
with:
path: mitls-fstar/
repository: project-everest/mitls-fstar
- name: Build
run: make -C mitls-fstar/src/tls -skj$(nproc)
- uses: mtzguido/gci-upload@master
with:
name: mitls-fstar
hometag: MITLS
test-mitls-fstar:
runs-on: ubuntu-latest
container: mtzguido/fstar-base-testing
needs:
- build-fstar
- build-krml
- build-hacl
- build-everparse
- build-mitls-fstar
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/opam" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- uses: mtzguido/gci-download@master
with:
name: FStar
- uses: mtzguido/gci-download@master
with:
name: karamel
- uses: mtzguido/gci-download@master
with:
name: everparse
- uses: mtzguido/gci-download@master
with:
name: hacl-star
- uses: mtzguido/gci-download@master
with:
name: mitls-fstar
- name: Build
run: make -C mitls-fstar/src/tls -skj$(nproc) test
### Nix jobs, for some Inria projects
#
# NOTE: these jobs are not containerized
# 1- it should not be needed since Nix takes care of isolating the environment
# 2- it would actually fail to setup Nix due to permissions in the container, and I haven't
# found a clear reference on what the permissions/uids should be.
#
# The fstar-nix job is here to
# 1- Test the nix build in this workflow too
# 2- Reuse the built F* in the following projects, via the magic-nix-cache (note the 'needs')
fstar-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build
run: nix build -L
comparse:
needs: fstar-nix
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: actions/checkout@master
with:
repository: TWal/comparse
- name: Update fstar flake and check
run: |
nix flake update --update-input fstar-flake --override-input fstar-flake "github:${{github.repository}}?rev=${{github.sha}}"
nix flake check
dy-star:
needs: fstar-nix
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: actions/checkout@master
with:
repository: REPROSEC/dolev-yao-star-extrinsic
- name: Update fstar flake and check
run: |
nix flake update --update-input fstar-flake --override-input fstar-flake "github:${{github.repository}}?rev=${{github.sha}}"
nix flake check
mls-star:
needs: fstar-nix
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: actions/checkout@master
with:
repository: Inria-Prosecco/mls-star
- name: Update fstar flake and check
run: |
nix flake update --update-input fstar-flake --override-input fstar-flake "github:${{github.repository}}?rev=${{github.sha}}"
nix flake check