From 944410d3c70149a3845697cd55ac2fb094f386cc Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 13 May 2024 22:08:46 -0400 Subject: [PATCH] CI: run all tests on linux and various OCaml versions and run macOS stuff only for 5.1 --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++------------ tests/core/t_list.ml | 13 +++++++------ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 391f92a0f..2dc82c3fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,9 +14,7 @@ jobs: fail-fast: true matrix: os: - - macos-latest - ubuntu-latest - #- windows-latest ocaml-compiler: - '4.08' - '4.14' @@ -32,23 +30,37 @@ jobs: ocaml-compiler: ${{ matrix.ocaml-compiler }} dune-cache: true allow-prerelease-opam: true - - run: opam install -t containers containers-data --deps-only - if: matrix.os == 'ubuntu-latest' + - run: opam exec -- dune build '@install' + - run: opam exec -- dune runtest + compat: + name: build + timeout-minutes: 15 + strategy: + fail-fast: true + matrix: + os: + - macos-latest + - ubuntu-latest + #- windows-latest + ocaml-compiler: + - '5.1' + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@main + - name: Use OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + dune-cache: true + allow-prerelease-opam: true - run: | opam install -t containers --deps-only ; opam install containers-data --deps-only # no test deps - if: matrix.os != 'ubuntu-latest' - - run: opam exec -- dune build '@install' - - - run: opam exec -- dune runtest - if: ${{ matrix.os == 'ubuntu-latest' }} - - run: opam exec -- dune runtest -j 1 -p containers # test only core on non-ubuntu platform - if: ${{ matrix.os != 'ubuntu-latest' }} - format: name: format diff --git a/tests/core/t_list.ml b/tests/core/t_list.ml index f3193e36e..70e36b6d4 100644 --- a/tests/core/t_list.ml +++ b/tests/core/t_list.ml @@ -140,13 +140,14 @@ let () = l; true -[@@@endif];; +[@@@endif] -q - Q.(list int) - (fun l -> - fold_flat_map (fun acc x -> x :: acc, [ x; x + 10 ]) [] l - = (List.rev l, flat_map (fun x -> [ x; x + 10 ]) l)) +let () = + q + Q.(list int) + (fun l -> + fold_flat_map (fun acc x -> x :: acc, [ x; x + 10 ]) [] l + = (List.rev l, flat_map (fun x -> [ x; x + 10 ]) l)) ;; eq ~printer:Q.Print.(list int) ~name:"unfold1" [ 0; 2; 4; 6; 8; 10 ]