16
16
matrix :
17
17
os :
18
18
- ubuntu-latest
19
+ os-name :
20
+ - Ubuntu
19
21
ocaml-compiler :
20
22
- " 4.14"
21
23
- " 5.0"
@@ -27,30 +29,50 @@ jobs:
27
29
- false
28
30
all_jane_street_tests :
29
31
- false
32
+ wasi :
33
+ - false
30
34
include :
31
35
- os : macos-latest
36
+ os-name : MacOS
32
37
ocaml-compiler : " 5.3"
33
38
separate_compilation : true
34
39
jane_street_tests : false
35
40
all_jane_street_tests : false
41
+ wasi : false
36
42
- os : windows-latest
43
+ os-name : Windows
37
44
ocaml-compiler : " 5.2"
38
45
separate_compilation : true
39
46
jane_street_tests : true
40
47
all_jane_street_tests : true
48
+ wasi : false
41
49
- os : ubuntu-latest
50
+ os-name : Ubuntu
42
51
ocaml-compiler : " 5.2"
43
52
separate_compilation : true
44
53
jane_street_tests : true
45
54
all_jane_street_tests : true
55
+ wasi : false
46
56
- os : ubuntu-latest
57
+ os-name : Ubuntu
47
58
ocaml-compiler : " 5.2"
48
59
separate_compilation : false
49
60
jane_street_tests : true
50
61
all_jane_street_tests : false
62
+ wasi : false
63
+ - os : ubuntu-latest
64
+ os-name : Ubuntu
65
+ ocaml-compiler : " 5.3"
66
+ separate_compilation : true
67
+ jane_street_tests : false
68
+ all_jane_street_tests : false
69
+ wasi : true
51
70
52
71
runs-on : ${{ matrix.os }}
53
72
73
+ name :
74
+ ${{ matrix.wasi && 'WASI / ' || '' }}${{ (! matrix.separate_compilation) && 'Whole program / ' || ''}}${{ matrix.ocaml-compiler }} / ${{ matrix.os-name }}${{ matrix.all_jane_street_tests && ' / Jane Street tests' || ''}}
75
+
54
76
steps :
55
77
- name : Set git to use LF
56
78
if : ${{ matrix.os == 'windows-latest' && matrix.ocaml-compiler < 5.2 }}
77
99
with :
78
100
node-version : latest
79
101
102
+ - name : Set-up Rust toolchain
103
+ if : matrix.wasi
104
+ uses : actions-rust-lang/setup-rust-toolchain@v1
105
+
106
+ - name : Checkout Wasmtime
107
+ if : matrix.wasi
108
+ uses : actions/checkout@v4
109
+ with :
110
+ repository : bytecodealliance/wasmtime
111
+ path : wasmtime
112
+ submodules : true
113
+
114
+ - name : Build Wasmtime
115
+ if : matrix.wasi
116
+ working-directory : ./wasmtime
117
+ run : |
118
+ cargo build
119
+ echo `pwd`/target/debug >> "$GITHUB_PATH"
120
+
80
121
- name : Set-up OCaml ${{ matrix.ocaml-compiler }}
81
122
uses : ocaml/setup-ocaml@v3
82
123
with :
@@ -129,7 +170,7 @@ jobs:
129
170
opam install . -t
130
171
131
172
- name : Run tests
132
- if : ${{ matrix.separate_compilation }}
173
+ if : ${{ matrix.separate_compilation && ! matrix.wasi }}
133
174
working-directory : ./wasm_of_ocaml
134
175
run : opam exec -- dune build @runtest-wasm
135
176
@@ -138,11 +179,26 @@ jobs:
138
179
# See https://github.com/libuv/libuv/issues/3622
139
180
140
181
- name : Run tests with CPS effects
141
- if : ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }}
182
+ if : ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation && ! matrix.wasi }}
142
183
continue-on-error : ${{ matrix.os == 'windows-latest' }}
143
184
working-directory : ./wasm_of_ocaml
144
185
run : opam exec -- dune build @runtest-wasm --profile with-effects
145
186
187
+ - name : Run tests (WASI runtime - node)
188
+ if : ${{ matrix.wasi }}
189
+ working-directory : ./wasm_of_ocaml
190
+ run : opam exec -- dune build @runtest-wasm --profile wasi
191
+
192
+ - name : Run tests (WASI runtime - wasmtime)
193
+ if : ${{ matrix.wasi }}
194
+ working-directory : ./wasm_of_ocaml
195
+ env :
196
+ WASM_ENGINE : wasmtime
197
+ WASI_FLAGS : --enable trap-on-exception
198
+ RUST_BACKTRACE : 0
199
+ continue-on-error : true
200
+ run : opam exec -- dune build @runtest-wasm --profile wasi
201
+
146
202
- name : Run Base tests
147
203
if : matrix.all_jane_street_tests
148
204
continue-on-error : ${{ matrix.os == 'windows-latest' }}
0 commit comments