@@ -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 :
@@ -140,7 +171,7 @@ jobs:
140
171
opam install . -t
141
172
142
173
- name : Run tests
143
- if : ${{ matrix.separate_compilation }}
174
+ if : ${{ matrix.separate_compilation && ! matrix.wasi }}
144
175
working-directory : ./wasm_of_ocaml
145
176
run : opam exec -- dune build @runtest-wasm
146
177
@@ -149,11 +180,24 @@ jobs:
149
180
# See https://github.com/libuv/libuv/issues/3622
150
181
151
182
- name : Run tests with CPS effects
152
- if : ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }}
183
+ if : ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation && ! matrix.wasi }}
153
184
continue-on-error : ${{ matrix.os == 'windows-latest' }}
154
185
working-directory : ./wasm_of_ocaml
155
186
run : opam exec -- dune build @runtest-wasm --profile with-effects
156
187
188
+ - name : Run tests (WASI runtime - node)
189
+ if : ${{ matrix.wasi }}
190
+ working-directory : ./wasm_of_ocaml
191
+ run : opam exec -- dune build @runtest-wasm --profile wasi
192
+
193
+ - name : Run tests (WASI runtime - wasmtime)
194
+ if : ${{ matrix.wasi }}
195
+ working-directory : ./wasm_of_ocaml
196
+ env :
197
+ WASM_ENGINE : wasmtime
198
+ WASI_FLAGS : --enable exnref
199
+ run : opam exec -- dune build @runtest-wasm --profile wasi
200
+
157
201
- name : Run Base tests
158
202
if : matrix.all_jane_street_tests
159
203
continue-on-error : ${{ matrix.os == 'windows-latest' }}
0 commit comments