-
Notifications
You must be signed in to change notification settings - Fork 73
337 lines (318 loc) · 12.7 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
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
name: ci
on:
push:
branches:
- 'main'
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
jobs:
fmt:
runs-on: macos-14
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup rust
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
- name: setup verusfmt
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/verus-lang/verusfmt/releases/latest/download/verusfmt-installer.sh | sh
- name: check rustfmt/verusfmt
working-directory: ./source
run: |
. ../tools/activate
vargo fmt -- --check
- name: check cargo fmt for vargo
working-directory: ./tools/vargo
run: |
cargo fmt -- --check
test-and-release-macos:
runs-on: macos-14
strategy:
matrix:
features: ['', 'record-history', 'no-std', 'no-alloc', 'singular', 'cvc5']
steps:
- name: checkout
uses: actions/checkout@v4
- name: get z3
working-directory: ./source
run: |
./tools/get-z3.sh
echo z3 version `./z3 --version`
- name: setup rust
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
- name: download singular
if: matrix.features == 'singular'
run: |
curl -LO https://www.singular.uni-kl.de/ftp/pub/Math/Singular/UNIX/Singular-4-3-2_M1.dmg
- name: build and test
working-directory: ./source
run: |
. ../tools/activate
vargo clean
case "${{ matrix.features }}" in
"singular")
hdiutil attach ../Singular-4-3-2_M1.dmg
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Volumes/Singular4.3.2/Singular.app/Contents/lib VERUS_SINGULAR_PATH=/Volumes/Singular4.3.2/Singular.app/Contents/bin/Singular VERUS_Z3_PATH="$(pwd)/z3" vargo build --features singular
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Volumes/Singular4.3.2/Singular.app/Contents/lib VERUS_SINGULAR_PATH=/Volumes/Singular4.3.2/Singular.app/Contents/bin/Singular VERUS_Z3_PATH="$(pwd)/z3" vargo test -p air --features singular
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Volumes/Singular4.3.2/Singular.app/Contents/lib VERUS_SINGULAR_PATH=/Volumes/Singular4.3.2/Singular.app/Contents/bin/Singular VERUS_Z3_PATH="$(pwd)/z3" vargo test -p rust_verify_test --features singular --test integer_ring
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Volumes/Singular4.3.2/Singular.app/Contents/lib VERUS_SINGULAR_PATH=/Volumes/Singular4.3.2/Singular.app/Contents/bin/Singular VERUS_Z3_PATH="$(pwd)/z3" vargo test -p rust_verify_test --features singular --test examples -- example_integer_ring
;;
"record-history")
vargo build --features record-history
VERUS_Z3_PATH="$(pwd)/z3" vargo test -p rust_verify_test --features record-history --test basic
;;
"no-std")
vargo build --vstd-no-std
cd vstd
unset -f cargo
cargo build --no-default-features --features alloc
;;
"no-alloc")
vargo build --vstd-no-std --vstd-no-alloc
cd vstd
unset -f cargo
cargo build --no-default-features
;;
"cvc5")
./tools/get-cvc5.sh
echo cvc5 version `./cvc5 --version`
vargo build
vargo run -p rust_verify -- -V cvc5 rust_verify/example/assorted_demo.rs
;;
*)
VERUS_Z3_PATH="$(pwd)/z3" vargo test -p air
VERUS_Z3_PATH="$(pwd)/z3" vargo test -p rust_verify_test
cd vstd
unset -f cargo
cargo build
;;
esac
- name: build verus release
if: matrix.features == ''
working-directory: ./source
run: |
. ../tools/activate
vargo clean
vargo build --release
./target-verus/release/verus --version --output-json > ./target-verus/release/version.json
cp -R ./target-verus/release ../verus-arm64-macos
cd ..; zip -r verus-arm64-macos.zip ./verus-arm64-macos
- name: run verus release
if: matrix.features == ''
working-directory: ./source
run: |
ls -Al ./target-verus/release
./target-verus/release/verus ./rust_verify/example/test.rs
- name: upload verus release artifact
uses: actions/upload-artifact@v4
if: matrix.features == ''
with:
name: verus-arm64-macos
path: verus-arm64-macos.zip
- name: build docs
if: matrix.features == ''
working-directory: ./source
run: |
./tools/docs.sh
- name: upload verusdoc artifact
uses: actions/upload-artifact@v4
if: matrix.features == ''
with:
name: verusdoc
path: source/doc
smoke-test-and-release-macos-x86:
runs-on: macos-13
steps:
- name: checkout
uses: actions/checkout@v4
- name: get z3
working-directory: ./source
run: |
./tools/get-z3.sh
echo z3 version `./z3 --version`
- name: setup rust
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
- name: build and test
working-directory: ./source
run: |
. ../tools/activate
vargo clean
vargo build
VERUS_Z3_PATH="$(pwd)/z3" vargo test -p rust_verify_test --test basic
- name: build verus release
working-directory: ./source
run: |
. ../tools/activate
vargo clean
vargo build --release
# TODO ./target-verus/release/verus --version --output-json > ./target-verus/release/version.json
cp -R ./target-verus/release ../verus-x86-macos
cd ..; zip -r verus-x86-macos.zip ./verus-x86-macos
- name: run verus release
working-directory: ./source
run: |
ls -Al ./target-verus/release
./target-verus/release/verus ./rust_verify/example/test.rs
- name: upload verus release artifact
uses: actions/upload-artifact@v4
with:
name: verus-x86-macos
path: verus-x86-macos.zip
smoke-test-and-release-windows:
runs-on: windows-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: get z3
shell: pwsh
working-directory: .\source
run: |
.\tools\get-z3.ps1
Write-Host "z3 version $(.\z3.exe --version)"
- name: setup rust
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
del rustup-init.exe
shell: powershell
- name: build verus release
working-directory: .\source
run: |
../tools/activate.ps1
$env:VERUS_Z3_PATH = "$(Get-Location)\z3.exe"; vargo build --release
# TODO: (currently fails misteriously) $env:VERUS_Z3_PATH = "$(Get-Location)/z3.exe"; ./target-verus/release/verus.exe --version --output-json > ./target-verus/release/version.json
cp -R ./target-verus/release ../verus-x86-win
cd ..; Compress-Archive -Path .\verus-x86-win -DestinationPath .\verus-x86-win.zip
shell: powershell
- name: run verus release
working-directory: .\source
run: |
ls .\target-verus\release
$env:VERUS_Z3_PATH = "$(Get-Location)\z3.exe"; Start-Process "$(Get-Location)\target-verus\release\verus.exe" "$(Get-Location)\rust_verify\example\test.rs"
shell: powershell
- name: upload verus release artifact
uses: actions/upload-artifact@v4
with:
name: verus-x86-win
path: verus-x86-win.zip
smoke-test-and-release-linux:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: get z3
working-directory: ./source
run: |
./tools/get-z3.sh
echo z3 version `./z3 --version`
- name: setup rust
run: |
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
- name: build and test
working-directory: ./source
run: |
. ../tools/activate
vargo clean
vargo build
VERUS_Z3_PATH="$(pwd)/z3" vargo test -p rust_verify_test --test basic
- name: build verus release
working-directory: ./source
run: |
. ../tools/activate
vargo clean
vargo build --release
# TODO ./target-verus/release/verus --version --output-json > ./target-verus/release/version.json
cp -R ./target-verus/release ../verus-x86-linux
cd ..; zip -r verus-x86-linux.zip ./verus-x86-linux
- name: run verus release
working-directory: ./source
run: |
ls -Al ./target-verus/release
./target-verus/release/verus ./rust_verify/example/test.rs
- name: upload verus release artifact
uses: actions/upload-artifact@v4
with:
name: verus-x86-linux
path: verus-x86-linux.zip
release:
needs: [fmt, smoke-test-and-release-linux, smoke-test-and-release-windows, test-and-release-macos, smoke-test-and-release-macos-x86]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: download all artifacts
uses: actions/download-artifact@v4
- name: create release tag
shell: bash
run: |
cd verus-x86-linux; unzip verus-x86-linux.zip; cd ..
echo "TAG_NAME=release/rolling/$(cat ./verus-x86-linux/verus-x86-linux/version.txt)" >> $GITHUB_ENV
echo "RELEASE_NAME=$(cat ./verus-x86-linux/verus-x86-linux/version.txt)" >> $GITHUB_ENV
echo $RELEASE_NAME $TAG_NAME
- name: list artifacts
run: |
ls -Al .
- name: update release
id: update_release
uses: utaal/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: 163437062
new_name: Rolling Release ${{ env.RELEASE_NAME }}
new_body: |
Rolling release from Continuous Integration
delete_tags_prefix: release/rolling/
delete_assets: true
new_draft_status: true
- name: upload release for x86-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.update_release.outputs.upload_url }}
asset_path: ./verus-x86-linux/verus-x86-linux.zip
asset_name: verus-${{ env.RELEASE_NAME }}-x86-linux.zip
asset_content_type: application/zip
- name: upload release for arm64-macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.update_release.outputs.upload_url }}
asset_path: ./verus-arm64-macos/verus-arm64-macos.zip
asset_name: verus-${{ env.RELEASE_NAME }}-arm64-macos.zip
asset_content_type: application/zip
- name: upload release for x86-macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.update_release.outputs.upload_url }}
asset_path: ./verus-x86-macos/verus-x86-macos.zip
asset_name: verus-${{ env.RELEASE_NAME }}-x86-macos.zip
asset_content_type: application/zip
- name: upload release for x86-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.update_release.outputs.upload_url }}
asset_path: ./verus-x86-win/verus-x86-win.zip
asset_name: verus-${{ env.RELEASE_NAME }}-x86-win.zip
asset_content_type: application/zip
- name: publish release
uses: utaal/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: 163437062
new_tag: ${{ env.TAG_NAME }}
new_draft_status: false