@@ -29,13 +29,16 @@ jobs:
29
29
- false
30
30
all_jane_street_tests :
31
31
- false
32
+ wasi :
33
+ - false
32
34
include :
33
35
- os : macos-latest
34
36
os-name : MacOS
35
37
ocaml-compiler : " 5.3"
36
38
separate_compilation : true
37
39
jane_street_tests : false
38
40
all_jane_street_tests : false
41
+ wasi : false
39
42
- os : windows-latest
40
43
os-name : Windows
41
44
ocaml-compiler : " 5.3"
@@ -49,17 +52,26 @@ jobs:
49
52
separate_compilation : true
50
53
jane_street_tests : true
51
54
all_jane_street_tests : true
55
+ wasi : false
52
56
- os : ubuntu-latest
53
57
os-name : Ubuntu
54
58
ocaml-compiler : " 5.3"
55
59
separate_compilation : false
56
60
jane_street_tests : true
57
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
58
70
59
71
runs-on : ${{ matrix.os }}
60
72
61
73
name :
62
- ${{ (! matrix.separate_compilation) && 'Whole program / ' || ''}}${{ matrix.ocaml-compiler }} / ${{ matrix.os-name }}${{ matrix.all_jane_street_tests && ' / Jane Street tests' || ''}}
74
+ ${{ matrix.wasi && 'WASI / ' || '' }}${{ (! matrix.separate_compilation) && 'Whole program / ' || ''}}${{ matrix.ocaml-compiler }} / ${{ matrix.os-name }}${{ matrix.all_jane_street_tests && ' / Jane Street tests' || ''}}
63
75
64
76
steps :
65
77
- name : Update apt cache
@@ -91,6 +103,25 @@ jobs:
91
103
with :
92
104
node-version : latest
93
105
106
+ - name : Set-up Rust toolchain
107
+ if : matrix.wasi
108
+ uses : actions-rust-lang/setup-rust-toolchain@v1
109
+
110
+ - name : Checkout Wasmtime
111
+ if : matrix.wasi
112
+ uses : actions/checkout@v4
113
+ with :
114
+ repository : bytecodealliance/wasmtime
115
+ path : wasmtime
116
+ submodules : true
117
+
118
+ - name : Build Wasmtime
119
+ if : matrix.wasi
120
+ working-directory : ./wasmtime
121
+ run : |
122
+ cargo build
123
+ echo `pwd`/target/debug >> "$GITHUB_PATH"
124
+
94
125
- name : Set-up OCaml ${{ matrix.ocaml-compiler }}
95
126
uses : ocaml/setup-ocaml@v3
96
127
with :
@@ -137,7 +168,7 @@ jobs:
137
168
opam install . -t
138
169
139
170
- name : Run tests
140
- if : ${{ matrix.separate_compilation }}
171
+ if : ${{ matrix.separate_compilation && ! matrix.wasi }}
141
172
working-directory : ./wasm_of_ocaml
142
173
run : opam exec -- dune build @runtest-wasm
143
174
@@ -146,11 +177,26 @@ jobs:
146
177
# See https://github.com/libuv/libuv/issues/3622
147
178
148
179
- name : Run tests with CPS effects
149
- if : ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }}
180
+ if : ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation && ! matrix.wasi }}
150
181
continue-on-error : ${{ matrix.os == 'windows-latest' }}
151
182
working-directory : ./wasm_of_ocaml
152
183
run : opam exec -- dune build @runtest-wasm --profile with-effects
153
184
185
+ - name : Run tests (WASI runtime - node)
186
+ if : ${{ matrix.wasi }}
187
+ working-directory : ./wasm_of_ocaml
188
+ run : opam exec -- dune build @runtest-wasm --profile wasi
189
+
190
+ - name : Run tests (WASI runtime - wasmtime)
191
+ if : ${{ matrix.wasi }}
192
+ working-directory : ./wasm_of_ocaml
193
+ env :
194
+ WASM_ENGINE : wasmtime
195
+ WASI_FLAGS : --enable trap-on-exception
196
+ RUST_BACKTRACE : 0
197
+ continue-on-error : true
198
+ run : opam exec -- dune build @runtest-wasm --profile wasi
199
+
154
200
- name : Run Base tests
155
201
if : matrix.all_jane_street_tests
156
202
continue-on-error : ${{ matrix.os == 'windows-latest' }}
0 commit comments