From 94772c7fe49740a91564d2f6854568c5bbf21a4d Mon Sep 17 00:00:00 2001 From: Shon Feder Date: Thu, 10 Jul 2025 17:48:50 -0400 Subject: [PATCH] Fix GitHub actions for Ocaml5 specific tests Co-authored-by: Puneeth Chaganti --- .github/workflows/main.yml | 13 +++++++------ src/client-cohttp-eio/dune | 2 ++ tests/bin/dune | 2 ++ tests/client_e2e/dune | 4 ++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78fbfb4a..beea2eae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,11 +5,12 @@ on: push: branches: - main + - add-eio-backend jobs: build: strategy: - fail-fast: true + fail-fast: false matrix: os: - ubuntu-latest @@ -47,14 +48,14 @@ jobs: opam install pbrt -y # We cannot install packages that need eio on ocaml versions before 5 - - if: ${{ ! startsWith("5" matrix.ocaml-compiler) }} - run: | - packages=$(ls *.opam | grep -v eio) + - run: | + packages=$(ls ./*.opam | grep -v eio) opam install $packages --deps-only --with-test --solver=mccs + if: ${{ ! (startsWith(matrix.ocaml-compiler, '5')) }} # We should be able to install all packages on ocaml 5 - - if: ${{ startsWith("5" matrix.ocaml-compiler) }} - run: opam install . --deps-only --with-test --solver=mccs + - run: opam install . --deps-only --with-test --solver=mccs + if: ${{ startsWith(matrix.ocaml-compiler, '5') }} - run: opam exec -- dune build @install -p opentelemetry,opentelemetry-lwt,opentelemetry-client-ocurl,opentelemetry-cohttp-lwt,opentelemetry-client-cohttp-lwt diff --git a/src/client-cohttp-eio/dune b/src/client-cohttp-eio/dune index 0c75d658..a1494d02 100644 --- a/src/client-cohttp-eio/dune +++ b/src/client-cohttp-eio/dune @@ -2,6 +2,8 @@ (name opentelemetry_client_cohttp_eio) (public_name opentelemetry-client-cohttp-eio) (synopsis "Opentelemetry collector using cohttp+eio+unix") + (enabled_if + (>= %{ocaml_version} 5.0)) (libraries opentelemetry opentelemetry.client diff --git a/tests/bin/dune b/tests/bin/dune index 60da511a..58a2e110 100644 --- a/tests/bin/dune +++ b/tests/bin/dune @@ -25,6 +25,8 @@ (modules emit1_eio) (preprocess (pps lwt_ppx)) + (enabled_if + (>= %{ocaml_version} 5.0)) (libraries unix logs diff --git a/tests/client_e2e/dune b/tests/client_e2e/dune index 44897079..d553490f 100644 --- a/tests/client_e2e/dune +++ b/tests/client_e2e/dune @@ -31,6 +31,8 @@ (names test_cottp_lwt_client_e2e) (modules test_cottp_lwt_client_e2e) (package opentelemetry-client-cohttp-lwt) + (enabled_if + (>= %{ocaml_version} 5.0)) (deps %{bin:emit1_cohttp} %{bin:emit1_eio}) (libraries clients_e2e_lib alcotest opentelemetry opentelemetry.client)) @@ -39,6 +41,8 @@ (modules test_cottp_eio_client_e2e) (package opentelemetry-client-cohttp-eio) (deps %{bin:emit1_eio}) + (enabled_if + (>= %{ocaml_version} 5.0)) (libraries clients_e2e_lib alcotest opentelemetry opentelemetry.client)) (executable