Skip to content

Commit 4b57097

Browse files
committed
CI updates
1 parent 3e78886 commit 4b57097

File tree

2 files changed

+70
-3
lines changed

2 files changed

+70
-3
lines changed

.github/workflows/build-wasm_of_ocaml.yml

+58-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
matrix:
1717
os:
1818
- ubuntu-latest
19+
os-name:
20+
- Ubuntu
1921
ocaml-compiler:
2022
- "4.14"
2123
- "5.0"
@@ -27,30 +29,50 @@ jobs:
2729
- false
2830
all_jane_street_tests:
2931
- false
32+
wasi:
33+
- false
3034
include:
3135
- os: macos-latest
36+
os-name: MacOS
3237
ocaml-compiler: "5.3"
3338
separate_compilation: true
3439
jane_street_tests: false
3540
all_jane_street_tests: false
41+
wasi: false
3642
- os: windows-latest
43+
os-name: Windows
3744
ocaml-compiler: "5.2"
3845
separate_compilation: true
3946
jane_street_tests: true
4047
all_jane_street_tests: true
48+
wasi: false
4149
- os: ubuntu-latest
50+
os-name: Ubuntu
4251
ocaml-compiler: "5.2"
4352
separate_compilation: true
4453
jane_street_tests: true
4554
all_jane_street_tests: true
55+
wasi: false
4656
- os: ubuntu-latest
57+
os-name: Ubuntu
4758
ocaml-compiler: "5.2"
4859
separate_compilation: false
4960
jane_street_tests: true
5061
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
5170

5271
runs-on: ${{ matrix.os }}
5372

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+
5476
steps:
5577
- name: Set git to use LF
5678
if: ${{ matrix.os == 'windows-latest' && matrix.ocaml-compiler < 5.2 }}
@@ -77,6 +99,25 @@ jobs:
7799
with:
78100
node-version: latest
79101

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+
80121
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
81122
uses: ocaml/setup-ocaml@v3
82123
with:
@@ -129,7 +170,7 @@ jobs:
129170
opam install . -t
130171
131172
- name: Run tests
132-
if: ${{ matrix.separate_compilation }}
173+
if: ${{ matrix.separate_compilation && ! matrix.wasi }}
133174
working-directory: ./wasm_of_ocaml
134175
run: opam exec -- dune build @runtest-wasm
135176

@@ -138,11 +179,26 @@ jobs:
138179
# See https://github.com/libuv/libuv/issues/3622
139180

140181
- 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 }}
142183
continue-on-error: ${{ matrix.os == 'windows-latest' }}
143184
working-directory: ./wasm_of_ocaml
144185
run: opam exec -- dune build @runtest-wasm --profile with-effects
145186

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+
146202
- name: Run Base tests
147203
if: matrix.all_jane_street_tests
148204
continue-on-error: ${{ matrix.os == 'windows-latest' }}

dune

+12-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
wasi
3939
(:include wasi_extra_flags)))
4040
(flags
41-
(:standard --pretty --enable wasi))
41+
(:standard
42+
--pretty
43+
--enable
44+
wasi
45+
(:include wasi_extra_flags)))
4246
(compilation_mode separate))
4347
(binaries
4448
(tools/node_wrapper.exe as node)
@@ -68,6 +72,13 @@
6872
%{dep:VERSION}
6973
%{dep:tools/version/GIT-VERSION}))))
7074

75+
(rule
76+
(targets wasi_extra_flags)
77+
(action
78+
(with-stdout-to
79+
%{targets}
80+
(echo "(%{env:WASI_FLAGS=})"))))
81+
7182
(data_only_dirs _wikidoc doc-dev janestreet)
7283

7384
(vendored_dirs)

0 commit comments

Comments
 (0)