2020 - 5.00.x
2121 - 5.01.x
2222 - 5.02.x
23+ separate_compilation :
24+ - true
2325 include :
2426 - os : macos-latest
2527 ocaml-compiler : 5.02.x
28+ separate_compilation : true
29+ - os : ubuntu-latest
30+ ocaml-compiler : 4.14.x
31+ separate_compilation : false
2632
2733 runs-on : ${{ matrix.os }}
2834
@@ -80,51 +86,10 @@ jobs:
8086 run : |
8187 echo "$GITHUB_WORKSPACE/binaryen/bin" >> $GITHUB_PATH
8288
83- - name : Restore cached OCaml
84- id : cache-ocaml
85- uses : actions/cache/restore@v4
86- with :
87- path : |
88- ~/.opam
89- _opam
90- /opt/hostedtoolcache/opam
91- /Users/runner/hostedtoolcache/opam
92- key : ${{ runner.os }}-ocaml-${{ matrix.ocaml-compiler }}
93-
9489 - name : Install OCaml ${{ matrix.ocaml-compiler }}
95- if : steps.cache-ocaml.outputs.cache-hit != 'true'
9690 uses : ocaml/setup-ocaml@v3
9791 with :
9892 ocaml-compiler : ${{ matrix.ocaml-compiler }}
99- dune-cache : true
100- opam-depext : true
101- opam-depext-flags : --with-test
102-
103- - name : Install packages (Ubuntu)
104- if : matrix.os == 'ubuntu-latest' && steps.cache-ocaml.outputs.cache-hit
105- run : sudo apt-get install bubblewrap
106-
107- - name : Install packages (MacOs)
108- if : matrix.os == 'macos-latest' && steps.cache-ocaml.outputs.cache-hit
109- # for graphics
110- run : brew install xquartz
111-
112- - name : Set opam path
113- if : steps.cache-ocaml.outputs.cache-hit
114- run : |
115- echo /opt/hostedtoolcache/opam/*/x86_64 >> $GITHUB_PATH
116- echo /Users/runner/hostedtoolcache/opam/*/arm64 >> $GITHUB_PATH
117-
118- - name : Cache OCaml
119- if : steps.cache-ocaml.outputs.cache-hit != 'true'
120- uses : actions/cache/save@v4
121- with :
122- path : |
123- ~/.opam
124- _opam
125- /opt/hostedtoolcache/opam
126- /Users/runner/hostedtoolcache/opam
127- key : ${{ runner.os }}-ocaml-${{ matrix.ocaml-compiler }}
12893
12994 - name : Checkout code
13095 uses : actions/checkout@v4
@@ -133,11 +98,7 @@ jobs:
13398
13499 - name : Pin faked binaryen-bin package
135100 # It's faster to use a cached version
136- working-directory : ./binaryen
137- run : |
138- echo opam-version: '"2.0"' > binaryen-bin.opam
139- opam pin -n .
140- rm binaryen-bin.opam
101+ run : opam install --fake binaryen-bin
141102
142103 - name : Checkout Jane Street opam repository
143104 uses : actions/checkout@v4
@@ -147,82 +108,79 @@ jobs:
147108 path : jane-street/opam-repository
148109
149110 - name : Pin dune
150- run : |
151- opam pin add -n dune.3.17 https://github.com/ocaml/dune.git
111+ run : opam pin add -n dune.3.17 https://github.com/ocaml/dune.git
152112
153113 - name : Pin wasm_of_ocaml
154114 working-directory : ./wasm_of_ocaml
155- run : |
156- for i in *.opam; do opam pin add -n `basename $i .opam`.`< VERSION` .; done
115+ run : opam pin -n --with-version `< VERSION` .
157116
158- - name : Install opam file parser
159- run : opam install opam-format ocamlfind dune graphics
117+ - name : Install some needed packages
118+ run : opam install opam-format ocamlfind dune graphics cmdliner sexplib0.v0.16.0
160119
161120 - name : Checkout Jane Street packages
162121 run : opam exec -- ocaml wasm_of_ocaml/tools/ci_setup.ml
163122
164- - name : Update test dependencies
165- run : opam install num cohttp-lwt-unix ppx_expect cstruct
166-
167- - name : Install wasm_of_ocaml
123+ - name : Install wasm_of_ocaml and its test dependencies
168124 working-directory : ./wasm_of_ocaml
169- run : opam install `basename -s .opam *.opam`
125+ run : |
126+ opam install `basename -s .opam *.opam` num cohttp-lwt-unix ppx_expect cstruct
170127
171128 - name : Run tests
129+ if : ${{ matrix.separate_compilation }}
172130 working-directory : ./wasm_of_ocaml
173131 run : opam exec -- dune build @all @runtest --profile wasm
174132
175133 - name : Run tests with CPS effects
176- if : ${{ matrix.ocaml-compiler >= '5.' }}
134+ if : ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }}
177135 working-directory : ./wasm_of_ocaml
178136 run : opam exec -- dune build @all @runtest --profile wasm-effects
179137
180138 - name : Run Base tests
181- if : ${{ matrix.ocaml-compiler < '5.' }}
139+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
182140 working-directory : ./jane-street/lib/base
183141 run : opam exec -- dune runtest
184142
185143 - name : Run Base bigstring tests
186- if : ${{ matrix.ocaml-compiler < '5.' }}
144+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
187145 working-directory : ./jane-street/lib/base_bigstring
188146 run : opam exec -- dune runtest
189147
190148 - name : Run Core tests
191- if : ${{ matrix.ocaml-compiler < '5.' }}
149+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
192150 working-directory : ./jane-street/lib/core
193151 run : opam exec -- dune runtest
194152
195153 - name : Run Bignum tests
196- if : ${{ matrix.ocaml-compiler < '5.' }}
154+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
197155 working-directory : ./jane-street/lib/bignum
198156 run : opam exec -- dune runtest
199157
200158 - name : Run Bin_prot tests
201- if : ${{ matrix.ocaml-compiler < '5.' }}
159+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
202160 working-directory : ./jane-street/lib/bin_prot
203161 run : opam exec -- dune runtest
204162
205163 - name : Run String_dict tests
206- if : ${{ matrix.ocaml-compiler < '5.' }}
164+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
207165 working-directory : ./jane-street/lib/string_dict
208166 run : opam exec -- dune runtest
209167
210168 - name : Run Zarith tests
211- if : ${{ matrix.ocaml-compiler < '5.' }}
169+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
212170 working-directory : ./jane-street/lib/zarith_stubs_js
213171 run : opam exec -- dune runtest
214172
215173 - name : Run Virtual_dom tests
216- if : ${{ matrix.ocaml-compiler < '5.' }}
174+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
217175 working-directory : ./jane-street/lib/virtual_dom
218176 run : opam exec -- dune runtest
219177
220178 - name : Run Bonsai tests
221- if : ${{ matrix.ocaml-compiler < '5.' }}
179+ if : ${{ matrix.ocaml-compiler < '5.' && matrix.separate_compilation }}
222180 working-directory : ./jane-street/lib/bonsai
223181 run : opam exec -- dune runtest
224182
225183 - name : Run Bonsai tests (release profile)
226- if : ${{ matrix.ocaml-compiler < '5.' }}
184+ if : ${{ ! matrix.separate_compilation }}
227185 working-directory : ./jane-street/lib/bonsai
228186 run : opam exec -- dune runtest --profile release
0 commit comments