CI: run all tests on linux and various OCaml versions

and run macOS stuff only for 5.1
This commit is contained in:
Simon Cruanes 2024-05-13 22:08:46 -04:00
parent 2e276002c6
commit 944410d3c7
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 31 additions and 18 deletions

View file

@ -14,9 +14,7 @@ jobs:
fail-fast: true fail-fast: true
matrix: matrix:
os: os:
- macos-latest
- ubuntu-latest - ubuntu-latest
#- windows-latest
ocaml-compiler: ocaml-compiler:
- '4.08' - '4.08'
- '4.14' - '4.14'
@ -32,23 +30,37 @@ jobs:
ocaml-compiler: ${{ matrix.ocaml-compiler }} ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true dune-cache: true
allow-prerelease-opam: true allow-prerelease-opam: true
- run: opam install -t containers containers-data --deps-only - 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: | - run: |
opam install -t containers --deps-only ; opam install -t containers --deps-only ;
opam install containers-data --deps-only # no test deps opam install containers-data --deps-only # no test deps
if: matrix.os != 'ubuntu-latest'
- run: opam exec -- dune build '@install' - 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 - run: opam exec -- dune runtest -j 1 -p containers # test only core on non-ubuntu platform
if: ${{ matrix.os != 'ubuntu-latest' }}
format: format:
name: format name: format

View file

@ -140,13 +140,14 @@ let () =
l; l;
true true
[@@@endif];; [@@@endif]
q let () =
Q.(list int) q
(fun l -> Q.(list int)
fold_flat_map (fun acc x -> x :: acc, [ x; x + 10 ]) [] l (fun l ->
= (List.rev l, flat_map (fun x -> [ x; x + 10 ]) 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 ] eq ~printer:Q.Print.(list int) ~name:"unfold1" [ 0; 2; 4; 6; 8; 10 ]