ocaml-opentelemetry/.github/workflows/main.yml
Raphaël Proust 74022be198
compatibility with lwt 6 (#128)
* compatibility with lwt 6

* try to work for lwt 5 and lwt 6

* CI: try lwt 5 then lwt 6

* only try lwt 6 on OCaml >= 5

* relax lwt bounds

* more robust dune rule

* CI

---------

Co-authored-by: Simon Cruanes <simon.cruanes.2007@m4x.org>
2026-03-13 15:17:09 -04:00

75 lines
2.2 KiB
YAML

name: build
on:
pull_request:
push:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
#- windows-latest
#- macos-latest
ocaml-compiler:
- 4.08.x
- 4.13.x
- 5.0.x
- 5.3.x
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
# needed for depext to work
- run: sudo apt-get update && sudo apt-get install mccs
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-depext-flags: --with-test
dune-cache: true
allow-prerelease-opam: true
- run: |
opam install pbrt.4.0 -y
opam install ambient-context lwt.5.9.2
# We cannot install packages that need eio on ocaml versions before 5
- 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
- run: opam install . --deps-only --with-test --solver=mccs
if: ${{ startsWith(matrix.ocaml-compiler, '5') }}
- run: opam exec -- dune build @install -p opentelemetry,opentelemetry-client,opentelemetry-lwt,opentelemetry-client-ocurl,opentelemetry-cohttp-lwt,opentelemetry-client-cohttp-lwt,opentelemetry-logs
- run: opam install trace
- run: opam exec -- dune build @install -p opentelemetry
- run: opam install lwt.6.1.1 -y
if: ${{ matrix.ocaml-compiler == '5.3.x' }}
- run: opam exec -- dune build @install -p opentelemetry,opentelemetry-client,opentelemetry-lwt,opentelemetry-client-cohttp-lwt
if: ${{ matrix.ocaml-compiler == '5.3.x' }}
- run: opam install ocaml-protoc
- run: opam exec -- dune build @lint
# check that nothing changed
- run: git diff --exit-code
- run: opam exec -- dune build @runtest
if: ${{ matrix.os == 'ubuntu-latest' }}