Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub Actions workflows #1782

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 33 additions & 52 deletions .github/workflows/build-wasm_of_ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
jobs:
build:
env:
OPAMJOBS: 2
OPAMYES: true
WASM_OF_OCAML: true

strategy:
Expand All @@ -19,45 +17,44 @@ jobs:
os:
- ubuntu-latest
ocaml-compiler:
- 4.14.x
- 5.0.x
- 5.1.x
- 5.2.x
- "4.14"
- "5.0"
- "5.1"
- "5.2"
- ocaml-compiler.5.3.0~beta2
separate_compilation:
- true
include:
- os: macos-latest
ocaml-compiler: 5.2.x
ocaml-compiler: "5.2"
separate_compilation: true
- os: ubuntu-latest
ocaml-compiler: 4.14.x
ocaml-compiler: "4.14"
separate_compilation: false

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

steps:
- name: Set git to use LF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to come back once we start testing windows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the upcoming PR, I'm going to make changes to separate the jobs for testing and installation testing so that we can run all tests on all platforms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate the jobs for testing and installation testing

I don't understand what you mean by that.

run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false
- name: Checkout tree
uses: actions/checkout@v4

- name: Install node
- name: Checkout Jane Street opam repository
uses: actions/checkout@v4
with:
repository: janestreet/opam-repository
ref: feaf8f831051fd5f316963b28efd728cf0b0eca1
path: janestreet/opam-repository

- name: Set-up Node.js
uses: actions/setup-node@v4
with:
node-version: 23
node-version: latest

- name: Install OCaml ${{ matrix.ocaml-compiler }}
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Checkout code
uses: actions/checkout@v4
with:
path: wasm_of_ocaml

- name: Set-up Binaryen
uses: Aandreba/[email protected]
with:
Expand All @@ -67,84 +64,68 @@ jobs:
# It's faster to use a cached version
run: opam install --fake binaryen-bin

- name: Checkout Jane Street opam repository
uses: actions/checkout@v4
with:
repository: janestreet/opam-repository
ref: feaf8f831051fd5f316963b28efd728cf0b0eca1
path: jane-street/opam-repository

- name: Pin wasm_of_ocaml
working-directory: ./wasm_of_ocaml
run: opam pin -n --with-version `< VERSION` .

- name: Install some needed packages
run: opam install opam-format ocamlfind dune graphics cmdliner sexplib0.v0.16.0

- name: Checkout Jane Street packages
run: opam exec -- ocaml wasm_of_ocaml/tools/ci_setup.ml

- name: Install wasm_of_ocaml and its test dependencies
working-directory: ./wasm_of_ocaml
run: |
opam install `basename -s .opam *.opam` num cohttp-lwt-unix ppx_expect cstruct
opam install opam-format ocamlfind dune graphics cmdliner sexplib0.v0.16.0
opam exec -- ocaml tools/ci_setup.ml

- name: Install dependencies
run: opam install . --deps-only --with-test

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

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

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

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

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

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

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

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

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

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

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

- name: Run Bonsai tests (release profile)
if: ${{ ! matrix.separate_compilation }}
working-directory: ./jane-street/lib/bonsai
working-directory: ./janestreet/lib/bonsai
run: opam exec -- dune runtest --profile release
21 changes: 6 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,15 @@ jobs:

steps:
- name: Set git to use LF
if: matrix.ocaml-compiler < 5.2
if: ${{ matrix.os == 'windows-latest' && matrix.ocaml-compiler < 5.2 }}
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false

- name: Checkout tree
uses: actions/checkout@v4

# EJGA: Note that I tried to fix this upstream as depext is
# getting much better, but no luck yet, c.f:
# https://github.com/ocaml/opam-repository/pull/26626
Expand All @@ -102,23 +105,15 @@ jobs:
# try to install them anyways, so we save an apt-roundtrip.
sudo aptitude -o Acquire::Retries=30 install gcc-multilib g++-multilib pkg-config libgmp-dev libgmp-dev:i386 libx11-dev:i386 -y

- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: latest

- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
opam-pin: false

- run: opam install conf-pkg-config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the second time you try to remove that line. It was here on purpose to work-around an opam packaging issue. Are you sure it is no longer needed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's no longer needed.

Copy link
Member Author

@smorimoto smorimoto Jan 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more clear, zarith now explicitly requires it, and conf-pkg-config is work properly in the Cygwin environment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember this being related to zarith

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for now, zarith is the only library which requires conf-pkg-config (on Windows)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though the issue was with mingw-64-shims and its optional dep on conf-pkg-config. Here is an extract of a private discussion with @dra27

Oh, I see what's happening here - it's a race
There's an instant during the recompile where the old mingw-64-shims package has been removed (so there's no x86_64-w64-mingw32-gcc shim installed) and those packages then try to call the C compiler.

@dra27 do you remember this issue, can you confirm it was fixed ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, it was fixed in mingw-w64-shims.0.2.0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I have failing logs involving mingw-w64-shims.0.2.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted in #1786

if: runner.os == 'Windows'

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

- run: cat VERSION | xargs opam pin . -n --with-version
if: ${{ !matrix.skip-test }}
shell: bash

- run: opam install . --with-test --deps-only
- run: opam install . --deps-only --with-test
# Install the test dependencies
if: ${{ !matrix.skip-test }}

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.2"
dune-cache: true
- uses: ocaml/setup-ocaml/lint-opam@v3

lint-fmt:
Expand All @@ -28,7 +27,6 @@ jobs:
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.2"
dune-cache: true
smorimoto marked this conversation as resolved.
Show resolved Hide resolved
- uses: ocaml/setup-ocaml/lint-fmt@v3

lint-runtime:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ benchmarks/results
benchmarks/config
benchmarks/programs


doc-dev
_wikidoc

Expand All @@ -55,3 +54,5 @@ toplevel/examples/lwt_toplevel_bin/test_dynlink.js
toplevel/examples/lwt_toplevel_bin/test_dynlink.cmi.js
toplevel/examples/lwt_toplevel_bin/toplevel.js
toplevel/examples/lwt_toplevel_bin/eval.js

janestreet
2 changes: 1 addition & 1 deletion dune
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
%{dep:VERSION}
%{dep:tools/version/GIT-VERSION}))))

(data_only_dirs _wikidoc doc-dev jane-street)
(data_only_dirs _wikidoc doc-dev janestreet)

(vendored_dirs)
13 changes: 6 additions & 7 deletions tools/ci_setup.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module StringSet = Set.Make (String)

(****)

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

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

Expand Down Expand Up @@ -212,7 +212,7 @@ let pin delay nm =
(Printf.sprintf
"opam pin add -n %s https://github.com/ocaml-wasm/%s.git#wasm"
(try List.assoc nm aliases
with Not_found -> if List.mem_assoc nm packages then nm ^ ".v0.16.0" else nm)
with Not_found -> if List.mem_assoc nm packages then nm ^ ".v0.16.1" else nm)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yet another change hidden in the noise that is not explained.

nm)

let pin_packages js =
Expand All @@ -231,7 +231,7 @@ let clone delay ?branch ?(depth = 1) nm src =
exec_async
~delay
(Printf.sprintf
"git clone -q --depth %d %s%s jane-street/lib/%s"
"git clone -q --depth %d %s%s janestreet/lib/%s"
depth
(match branch with
| None -> ""
Expand All @@ -246,12 +246,11 @@ let clone' delay ?branch ?commit nm src =
let* () = clone delay ?branch ~depth:100 nm src in
exec_async
~delay:0
(Printf.sprintf "cd jane-street/lib/%s && git checkout -b wasm %s" nm commit)
(Printf.sprintf "cd janestreet/lib/%s && git checkout -b wasm %s" nm commit)

let () =
Out_channel.(
with_open_bin "jane-street/dune-workspace"
@@ fun ch -> output_string ch dune_workspace)
with_open_bin "janestreet/dune-workspace" @@ fun ch -> output_string ch dune_workspace)

let () =
let js, others =
Expand Down Expand Up @@ -296,7 +295,7 @@ let () =
List.iter
(fun (dir, patch) ->
let ch =
Unix.open_process_out (Printf.sprintf "cd jane-street/lib/%s && patch -p 1" dir)
Unix.open_process_out (Printf.sprintf "cd janestreet/lib/%s && patch -p 1" dir)
in
output_string ch patch;
ignore (Unix.close_process_out ch))
Expand Down
Loading