Skip to content

Commit 3242ea5

Browse files
vouillonhhugo
authored andcommitted
CI: use node wrapper from tools/ to test Jane Street packages
1 parent 8d6da57 commit 3242ea5

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

.github/workflows/build-wasm_of_ocaml.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,6 @@ jobs:
120120
working-directory: ./wasm_of_ocaml
121121
run: opam exec -- dune build @runtest-wasm --profile with-effects
122122

123-
- name: Create node wrapper for Jane Street tests
124-
run: |
125-
mkdir -p ~/.local/bin
126-
cat > ~/.local/bin/node <<EOF
127-
#!/bin/sh
128-
exec `which node` --experimental-wasm-jspi "\$@"
129-
EOF
130-
chmod +x ~/.local/bin/node
131-
echo ~/.local/bin >> "$GITHUB_PATH"
132-
133123
- name: Run Base tests
134124
if: matrix.all_jane_street_tests
135125
working-directory: ./janestreet/lib/base

tools/ci_setup.ml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ let dune_workspace =
6060
(flags :standard -warn-error -7-8-27-30-32-34-37-49-52-55 -w -67-69)))
6161
|}
6262

63+
let node_wrapper =
64+
[ ( "node_wrapper/dune"
65+
, {|(executable
66+
(public_name node)
67+
(name node_wrapper)
68+
(libraries unix))|} )
69+
; "node_wrapper/dune-project", "(lang dune 3.17)"
70+
; "node_wrapper/node_wrapper.opam", ""
71+
]
72+
6373
let patches =
6474
[ ( "sexp_grammar"
6575
, {|
@@ -203,8 +213,23 @@ let clone' delay ?branch ?commit nm src =
203213
(Printf.sprintf "cd janestreet/lib/%s && git checkout -b wasm %s" nm commit)
204214

205215
let () =
206-
Out_channel.(
207-
with_open_bin "janestreet/dune-workspace" @@ fun ch -> output_string ch dune_workspace)
216+
let write f contents =
217+
Out_channel.(
218+
with_open_bin (Filename.concat "janestreet" f)
219+
@@ fun ch -> output_string ch contents)
220+
in
221+
let copy f f' =
222+
let contents =
223+
In_channel.(with_open_bin (Filename.concat "wasm_of_ocaml" f) @@ input_all)
224+
in
225+
Out_channel.(
226+
with_open_bin (Filename.concat "janestreet" f')
227+
@@ fun ch -> output_string ch contents)
228+
in
229+
write "dune-workspace" dune_workspace;
230+
Unix.mkdir "janestreet/node_wrapper" 0o755;
231+
List.iter (fun (f, contents) -> write f contents) node_wrapper;
232+
copy "tools/node_wrapper.ml" "node_wrapper/node_wrapper.ml"
208233

209234
let () =
210235
let js, others =

0 commit comments

Comments
 (0)