From d73baa700adfbbb3f0709e84dc8186691c779fc4 Mon Sep 17 00:00:00 2001 From: hhugo Date: Tue, 27 Jun 2023 20:19:17 +0200 Subject: [PATCH] CI improvements (#147) * Fix expect tests on windows * more ci jobs * standard ci * simplify --------- Co-authored-by: Hugo Heuzard --- .github/workflows/build.yml | 35 +++++++++++++++++++++++------------ .github/workflows/ci.yml | 18 ------------------ test/basic.ml | 1 + 3 files changed, 24 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d1ddef..1f8cf45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +16,15 @@ jobs: matrix: os: - ubuntu-latest + - macos-latest ocaml-compiler: - 4.14.x - skip-test: - - false + - 5.0.x include: - - os: ubuntu-latest - ocaml-compiler: 4.8.x - skip-test: true + - os: windows-latest + ocaml-compiler: 4.14.x + - os: windows-latest + ocaml-compiler: ocaml.5.0.0,ocaml-option-mingw runs-on: ${{ matrix.os }} @@ -38,27 +39,37 @@ jobs: uses: actions/checkout@v3 - name: Use OCaml ${{ matrix.ocaml-compiler }} + if: runner.os == 'Windows' uses: ocaml/setup-ocaml@v2 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} + opam-repositories: | + dra27: https://github.com/dra27/opam-repository.git#windows-5.0 + default: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset + opam: https://github.com/ocaml/opam-repository.git dune-cache: ${{ matrix.os == 'ubuntu-latest' }} - opam-depext: ${{ !matrix.skip-test }} + opam-depext: ${{ true }} opam-depext-flags: --with-test - - run: opam install . --best-effort - if: ${{ matrix.skip-test }} + - name: Use OCaml ${{ matrix.ocaml-compiler }} + if: runner.os != 'Windows' + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + dune-cache: ${{ matrix.os == 'ubuntu-latest' }} + opam-depext: ${{ true }} + opam-depext-flags: --with-test + + - run: opam pin add dune https://github.com/nojb/dune.git#async_io_self_pipe_win32-3.8.2 + if: runner.os == 'Windows' - run: opam install . --with-test - if: ${{ !matrix.skip-test }} - run: opam exec -- make build - if: ${{ !matrix.skip-test }} - run: opam exec -- make test - if: ${{ !matrix.skip-test }} - run: opam exec -- git diff --exit-code - if: ${{ !matrix.skip-test }} lint-fmt: runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e286b5c..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: CI - -on: [push] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - steps: - - name: Build and test module - uses: savonet/build-and-test-ocaml-module@main diff --git a/test/basic.ml b/test/basic.ml index ff93f17..31ca77a 100644 --- a/test/basic.ml +++ b/test/basic.ml @@ -1,3 +1,4 @@ +let () = set_binary_mode_out stdout true let digit = [%sedlex.regexp? '0' .. '9'] let number = [%sedlex.regexp? Plus digit]