Skip to content

Commit

Permalink
Restore Windows CI on Cygwin (#1203)
Browse files Browse the repository at this point in the history
The latest version of setup-ocaml has a new support for Windows. As we plan to support officially the Windows platform, we should test it on our CI. This PR restores the CI on Windows.

Currently, we compile with Cygwin because there is no support for MSYS2 in opam-setup yet.

I add a new tag unix for tests whose the purpose is to ignore tests on non-unix platform.
  • Loading branch information
Halbaroth authored Aug 9, 2024
1 parent d70635f commit 0d6300e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
os:
- macos-latest
- ubuntu-latest
- windows-latest
ocaml-compiler:
- 4.08.1
- 4.14.2
Expand All @@ -33,6 +34,9 @@ jobs:
# No longer seems to be available
- os: macos-latest
ocaml-compiler: 4.08.1
# Opam 2.2 requires at least OCaml 4.13
- os: windows-latest
ocaml-compiler: 4.08.1

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

Expand Down
9 changes: 8 additions & 1 deletion tools/gentest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ module Test : sig
filters: string list option;
compare_should_succeed: bool;
accepted_exit_codes: int list;
ignore: bool;
}

type t = private {
Expand Down Expand Up @@ -142,6 +143,7 @@ end = struct
filters: string list option;
compare_should_succeed: bool;
accepted_exit_codes: int list;
ignore: bool;
}

type t = {
Expand All @@ -157,6 +159,7 @@ end = struct
filters = None;
compare_should_succeed = true;
accepted_exit_codes = [0];
ignore = false;
}

let make ~cmd ~pb_file ~params ~root ~path =
Expand Down Expand Up @@ -250,6 +253,10 @@ end = struct
List.fold_left (
fun (acc : Test.params) ->
function
| "unix" when not Sys.unix -> {
acc with
ignore = true
}
| "fail" ->
{acc with compare_should_succeed = false}
| "err" ->
Expand Down Expand Up @@ -277,7 +284,7 @@ end = struct
(String.split_on_char '.' pb_file)
in
List.fold_left (fun acc2 cmd ->
if filter params cmd then
if not params.ignore && filter params cmd then
Test.make ~cmd ~pb_file ~params ~root ~path :: acc2
else
acc2
Expand Down

0 comments on commit 0d6300e

Please sign in to comment.