Skip to content

Commit 3478018

Browse files
committed
Update GitHub Actions workflows
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 61eb7cf commit 3478018

File tree

6 files changed

+48
-78
lines changed

6 files changed

+48
-78
lines changed

.github/workflows/build-wasm_of_ocaml.yml

+33-52
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ on:
99
jobs:
1010
build:
1111
env:
12-
OPAMJOBS: 2
13-
OPAMYES: true
1412
WASM_OF_OCAML: true
1513

1614
strategy:
@@ -19,45 +17,44 @@ jobs:
1917
os:
2018
- ubuntu-latest
2119
ocaml-compiler:
22-
- 4.14.x
23-
- 5.0.x
24-
- 5.1.x
25-
- 5.2.x
20+
- "4.14"
21+
- "5.0"
22+
- "5.1"
23+
- "5.2"
2624
- ocaml-compiler.5.3.0~beta2
2725
separate_compilation:
2826
- true
2927
include:
3028
- os: macos-latest
31-
ocaml-compiler: 5.2.x
29+
ocaml-compiler: "5.2"
3230
separate_compilation: true
3331
- os: ubuntu-latest
34-
ocaml-compiler: 4.14.x
32+
ocaml-compiler: "4.14"
3533
separate_compilation: false
3634

3735
runs-on: ${{ matrix.os }}
3836

3937
steps:
40-
- name: Set git to use LF
41-
run: |
42-
git config --global core.autocrlf false
43-
git config --global core.eol lf
44-
git config --global core.ignorecase false
38+
- name: Checkout tree
39+
uses: actions/checkout@v4
4540

46-
- name: Install node
41+
- name: Checkout Jane Street opam repository
42+
uses: actions/checkout@v4
43+
with:
44+
repository: janestreet/opam-repository
45+
ref: feaf8f831051fd5f316963b28efd728cf0b0eca1
46+
path: janestreet/opam-repository
47+
48+
- name: Set-up Node.js
4749
uses: actions/setup-node@v4
4850
with:
49-
node-version: 23
51+
node-version: latest
5052

51-
- name: Install OCaml ${{ matrix.ocaml-compiler }}
53+
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
5254
uses: ocaml/setup-ocaml@v3
5355
with:
5456
ocaml-compiler: ${{ matrix.ocaml-compiler }}
5557

56-
- name: Checkout code
57-
uses: actions/checkout@v4
58-
with:
59-
path: wasm_of_ocaml
60-
6158
- name: Set-up Binaryen
6259
uses: Aandreba/[email protected]
6360
with:
@@ -67,84 +64,68 @@ jobs:
6764
# It's faster to use a cached version
6865
run: opam install --fake binaryen-bin
6966

70-
- name: Checkout Jane Street opam repository
71-
uses: actions/checkout@v4
72-
with:
73-
repository: janestreet/opam-repository
74-
ref: feaf8f831051fd5f316963b28efd728cf0b0eca1
75-
path: jane-street/opam-repository
76-
77-
- name: Pin wasm_of_ocaml
78-
working-directory: ./wasm_of_ocaml
79-
run: opam pin -n --with-version `< VERSION` .
80-
81-
- name: Install some needed packages
82-
run: opam install opam-format ocamlfind dune graphics cmdliner sexplib0.v0.16.0
83-
8467
- name: Checkout Jane Street packages
85-
run: opam exec -- ocaml wasm_of_ocaml/tools/ci_setup.ml
86-
87-
- name: Install wasm_of_ocaml and its test dependencies
88-
working-directory: ./wasm_of_ocaml
8968
run: |
90-
opam install `basename -s .opam *.opam` num cohttp-lwt-unix ppx_expect cstruct
69+
opam install opam-format ocamlfind dune graphics cmdliner sexplib0.v0.16.0
70+
opam exec -- ocaml tools/ci_setup.ml
71+
72+
- name: Install dependencies
73+
run: opam install . --deps-only --with-test
9174

9275
- name: Run tests
9376
if: ${{ matrix.separate_compilation }}
94-
working-directory: ./wasm_of_ocaml
9577
run: opam exec -- dune build @runtest-wasm
9678

9779
- name: Run tests with CPS effects
9880
if: ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }}
99-
working-directory: ./wasm_of_ocaml
10081
run: opam exec -- dune build @runtest-wasm --profile with-effects
10182

10283
- name: Run Base tests
10384
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
104-
working-directory: ./jane-street/lib/base
85+
working-directory: ./janestreet/lib/base
10586
run: opam exec -- dune runtest
10687

10788
- name: Run Base bigstring tests
10889
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
109-
working-directory: ./jane-street/lib/base_bigstring
90+
working-directory: ./janestreet/lib/base_bigstring
11091
run: opam exec -- dune runtest
11192

11293
- name: Run Core tests
11394
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
114-
working-directory: ./jane-street/lib/core
95+
working-directory: ./janestreet/lib/core
11596
run: opam exec -- dune runtest
11697

11798
- name: Run Bignum tests
11899
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
119-
working-directory: ./jane-street/lib/bignum
100+
working-directory: ./janestreet/lib/bignum
120101
run: opam exec -- dune runtest
121102

122103
- name: Run Bin_prot tests
123104
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
124-
working-directory: ./jane-street/lib/bin_prot
105+
working-directory: ./janestreet/lib/bin_prot
125106
run: opam exec -- dune runtest
126107

127108
- name: Run String_dict tests
128109
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
129-
working-directory: ./jane-street/lib/string_dict
110+
working-directory: ./janestreet/lib/string_dict
130111
run: opam exec -- dune runtest
131112

132113
- name: Run Zarith tests
133114
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
134-
working-directory: ./jane-street/lib/zarith_stubs_js
115+
working-directory: ./janestreet/lib/zarith_stubs_js
135116
run: opam exec -- dune runtest
136117

137118
- name: Run Virtual_dom tests
138119
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
139-
working-directory: ./jane-street/lib/virtual_dom
120+
working-directory: ./janestreet/lib/virtual_dom
140121
run: opam exec -- dune runtest
141122

142123
- name: Run Bonsai tests
143124
if: ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
144-
working-directory: ./jane-street/lib/bonsai
125+
working-directory: ./janestreet/lib/bonsai
145126
run: opam exec -- dune runtest
146127

147128
- name: Run Bonsai tests (release profile)
148129
if: ${{ ! matrix.separate_compilation }}
149-
working-directory: ./jane-street/lib/bonsai
130+
working-directory: ./janestreet/lib/bonsai
150131
run: opam exec -- dune runtest --profile release

.github/workflows/build.yml

+6-15
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ jobs:
8383

8484
steps:
8585
- name: Set git to use LF
86-
if: matrix.ocaml-compiler < 5.2
86+
if: ${{ matrix.os == 'windows-latest' && matrix.ocaml-compiler < 5.2 }}
8787
run: |
8888
git config --global core.autocrlf false
8989
git config --global core.eol lf
9090
git config --global core.ignorecase false
9191
92+
- name: Checkout tree
93+
uses: actions/checkout@v4
94+
9295
# EJGA: Note that I tried to fix this upstream as depext is
9396
# getting much better, but no luck yet, c.f:
9497
# https://github.com/ocaml/opam-repository/pull/26626
@@ -102,23 +105,15 @@ jobs:
102105
# try to install them anyways, so we save an apt-roundtrip.
103106
sudo aptitude -o Acquire::Retries=30 install gcc-multilib g++-multilib pkg-config libgmp-dev libgmp-dev:i386 libx11-dev:i386 -y
104107
105-
- name: Checkout tree
106-
uses: actions/checkout@v4
107-
108108
- name: Set-up Node.js
109109
uses: actions/setup-node@v4
110110
with:
111-
node-version: lts/*
111+
node-version: latest
112112

113113
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
114114
uses: ocaml/setup-ocaml@v3
115115
with:
116116
ocaml-compiler: ${{ matrix.ocaml-compiler }}
117-
dune-cache: true
118-
opam-pin: false
119-
120-
- run: opam install conf-pkg-config
121-
if: runner.os == 'Windows'
122117

123118
- name: Set-up Binaryen
124119
uses: Aandreba/[email protected]
@@ -132,11 +127,7 @@ jobs:
132127
- run: opam install . --best-effort
133128
if: ${{ matrix.skip-test }}
134129

135-
- run: cat VERSION | xargs opam pin . -n --with-version
136-
if: ${{ !matrix.skip-test }}
137-
shell: bash
138-
139-
- run: opam install . --with-test --deps-only
130+
- run: opam install . --deps-only --with-test
140131
# Install the test dependencies
141132
if: ${{ !matrix.skip-test }}
142133

.github/workflows/lint.yml

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
uses: ocaml/setup-ocaml@v3
1717
with:
1818
ocaml-compiler: "5.2"
19-
dune-cache: true
2019
- uses: ocaml/setup-ocaml/lint-opam@v3
2120

2221
lint-fmt:
@@ -28,7 +27,6 @@ jobs:
2827
uses: ocaml/setup-ocaml@v3
2928
with:
3029
ocaml-compiler: "5.2"
31-
dune-cache: true
3230
- uses: ocaml/setup-ocaml/lint-fmt@v3
3331

3432
lint-runtime:

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ benchmarks/results
4646
benchmarks/config
4747
benchmarks/programs
4848

49-
5049
doc-dev
5150
_wikidoc
5251

@@ -55,3 +54,5 @@ toplevel/examples/lwt_toplevel_bin/test_dynlink.js
5554
toplevel/examples/lwt_toplevel_bin/test_dynlink.cmi.js
5655
toplevel/examples/lwt_toplevel_bin/toplevel.js
5756
toplevel/examples/lwt_toplevel_bin/eval.js
57+
58+
janestreet

dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
%{dep:VERSION}
4747
%{dep:tools/version/GIT-VERSION}))))
4848

49-
(data_only_dirs _wikidoc doc-dev jane-street)
49+
(data_only_dirs _wikidoc doc-dev janestreet)
5050

5151
(vendored_dirs)

tools/ci_setup.ml

+6-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module StringSet = Set.Make (String)
1010

1111
(****)
1212

13-
let repo = "jane-street/opam-repository/packages"
13+
let repo = "janestreet/opam-repository/packages"
1414

1515
let roots = [ "bonsai"; "string_dict" ]
1616

@@ -212,7 +212,7 @@ let pin delay nm =
212212
(Printf.sprintf
213213
"opam pin add -n %s https://github.com/ocaml-wasm/%s.git#wasm"
214214
(try List.assoc nm aliases
215-
with Not_found -> if List.mem_assoc nm packages then nm ^ ".v0.16.0" else nm)
215+
with Not_found -> if List.mem_assoc nm packages then nm ^ ".v0.16.1" else nm)
216216
nm)
217217

218218
let pin_packages js =
@@ -231,7 +231,7 @@ let clone delay ?branch ?(depth = 1) nm src =
231231
exec_async
232232
~delay
233233
(Printf.sprintf
234-
"git clone -q --depth %d %s%s jane-street/lib/%s"
234+
"git clone -q --depth %d %s%s janestreet/lib/%s"
235235
depth
236236
(match branch with
237237
| None -> ""
@@ -246,12 +246,11 @@ let clone' delay ?branch ?commit nm src =
246246
let* () = clone delay ?branch ~depth:100 nm src in
247247
exec_async
248248
~delay:0
249-
(Printf.sprintf "cd jane-street/lib/%s && git checkout -b wasm %s" nm commit)
249+
(Printf.sprintf "cd janestreet/lib/%s && git checkout -b wasm %s" nm commit)
250250

251251
let () =
252252
Out_channel.(
253-
with_open_bin "jane-street/dune-workspace"
254-
@@ fun ch -> output_string ch dune_workspace)
253+
with_open_bin "janestreet/dune-workspace" @@ fun ch -> output_string ch dune_workspace)
255254

256255
let () =
257256
let js, others =
@@ -296,7 +295,7 @@ let () =
296295
List.iter
297296
(fun (dir, patch) ->
298297
let ch =
299-
Unix.open_process_out (Printf.sprintf "cd jane-street/lib/%s && patch -p 1" dir)
298+
Unix.open_process_out (Printf.sprintf "cd janestreet/lib/%s && patch -p 1" dir)
300299
in
301300
output_string ch patch;
302301
ignore (Unix.close_process_out ch))

0 commit comments

Comments
 (0)