-
Notifications
You must be signed in to change notification settings - Fork 234
221 lines (190 loc) · 6.12 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
name: F* CI
on:
push:
workflow_dispatch:
workflow_call:
defaults:
run:
shell: bash
jobs:
build:
# Build an F* binary package: a fully-bootstrapped stage 2 compiler,
# with its plugins, a fully checked library (i.e. with .checked)
# files and compiled versions of fstar_lib and fstar_plugin_lib.
# Also, we build a full stage 1 compiler and its libraries, and
# make all possible artifacts.
runs-on: ubuntu-latest
container: mtzguido/dev-base
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/user" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- name: Checkout
uses: actions/checkout@master
- name: Produce all artifacts
run: make -skj$(nproc) all-packages FSTAR_VERSION=ci
- uses: actions/upload-artifact@v4
with:
path: fstar-ci.tar.gz
name: fstar-ci.tar.gz
retention-days: 3
- uses: actions/upload-artifact@v4
with:
path: fstar-ci-stage1.tar.gz
name: fstar-ci-stage1.tar.gz
retention-days: 3
- uses: actions/upload-artifact@v4
with:
path: fstar-ci-src.tar.gz
name: fstar-ci-src.tar.gz
retention-days: 3
- uses: actions/upload-artifact@v4
with:
path: fstar-ci-stage1-src.tar.gz
name: fstar-ci-stage1-src.tar.gz
retention-days: 3
# FIXME: Ideally, we could upload the artifacts as soon as each of
# them is created, and start the subsequent jobs at that instant too.
# Is that even doable...?
check-friends:
needs: build
name: friends
uses: ./.github/workflows/check-friends.yml
# This checks that the stage3 extracted fstarc matches exactly with stage2.
# There is some overlap with the job above, but the testing jobs do not
# need this bit at all and we have plenty of parallelism for now... so just
# spawn another one.
check-stage3-diff:
runs-on: ubuntu-latest
container: mtzguido/dev-base
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/user" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- name: Checkout
uses: actions/checkout@master
- name: Check for a stage 3 diff
run: make -skj$(nproc) stage3-diff
# Download the stage2 binary package from the previous job and run the tests
# in the repo. This makes sure that the tests do not depend on some
# random internal state of the repo, but only on out/.
#
# We could be paranoid and rm -rf ulib too, it should not make a difference.
#
# We also run all tests over the stage 1 compiler. They should all pass,
# just like for stage2. The compiler used to build fstar.exe itself
# should not matter.
test-local:
strategy:
fail-fast: false
matrix:
pak:
- fstar-ci.tar.gz
- fstar-ci-stage1.tar.gz
needs: build
runs-on: ubuntu-latest
container: mtzguido/dev-base
steps:
- name: Cleanup
run: find . -delete
- run: echo "HOME=/home/user" >> $GITHUB_ENV
- uses: mtzguido/set-opam-env@master
- name: Checkout
uses: actions/checkout@master
- name: Get fstar package
uses: actions/download-artifact@v4
with:
name: ${{ matrix.pak }}
- name: Set up package locally
run: mkdir -p out && tar xzf ${{ matrix.pak }} -C out
- name: Run tests
run: make -skj$(nproc) test
binary-smoke:
strategy:
fail-fast: false
matrix:
pak:
- fstar-ci.tar.gz
- fstar-ci-stage1.tar.gz
os:
# - ubuntu-20.04
# - ubuntu-22.04
- ubuntu-24.04
# - ubuntu-latest
# FIXME: the container builds with a recent glibc, use an older
# base system to get a more portable executable.
needs: build
runs-on: ${{ matrix.os }}
steps:
- uses: cda-tum/setup-z3@main
with:
version: 4.8.5
- name: Get fstar package
uses: actions/download-artifact@v4
with:
name: ${{ matrix.pak }}
- run: tar xzf ${{ matrix.pak }}
- name: Smoke test
run: |
./bin/fstar.exe ulib/Prims.fst -f
echo -e "module A\nopen FStar.Mul\nlet _ = assert (forall x. 1 + x*x > 0)" > A.fst
./bin/fstar.exe A.fst
ocaml-smoke:
strategy:
fail-fast: false
matrix:
pak:
- fstar-ci-src.tar.gz
- fstar-ci-stage1-src.tar.gz
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- ubuntu-latest
exclude:
- os: ubuntu-24.04 # setup-ocaml fails due to darcs https://github.com/ocaml/setup-ocaml/issues/872
needs: build
runs-on: ${{ matrix.os }}
steps:
- uses: cda-tum/setup-z3@main
with:
version: 4.8.5
- name: Get fstar package
uses: actions/download-artifact@v4
with:
name: ${{ matrix.pak }}
- run: tar xzf ${{ matrix.pak }}
- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 4.14.2
# F* includes an OPAM dependency to Z3, but we are just
# installing a binary with the action above, so we do not
# need it. This is also VERY slow as it builds the binary
# from source.
- run: sed -i '/"z3"/d' fstar.opam
- run: opam install . --deps-only --with-test
- run: eval $(opam env) && make -j$(nproc)
- name: Smoke test
run: |
./out/bin/fstar.exe out/ulib/Prims.fst -f
echo -e "module A\nopen FStar.Mul\nlet _ = assert (forall x. 1 + x*x > 0)" > A.fst
./out/bin/fstar.exe A.fst
perf-canaries:
needs: build
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@master
- uses: cda-tum/setup-z3@main
with:
version: 4.8.5
- name: Get fstar package
uses: actions/download-artifact@v4
with:
name: fstar-ci.tar.gz
- run: tar xzf fstar-ci.tar.gz
- name: Run perf canaries
run: .scripts/perf_canaries.sh ./bin/fstar.exe