ocaml-opentelemetry/.github/workflows/main.yml
Simon Cruanes 4e80493e4a
run gha as root in docker
using the opam user wouldn't work for actions like checkout
2026-04-06 11:59:28 -04:00

52 lines
1.5 KiB
YAML

name: build
on:
pull_request:
push:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- ocaml-version: "4.08"
container: ghcr.io/ocaml-tracing/ocaml-opentelemetry/ci-4.08:latest
eio: false
- ocaml-version: "4.14"
container: ghcr.io/ocaml-tracing/ocaml-opentelemetry/ci-4.14:latest
eio: false
- ocaml-version: "5.4"
container: ghcr.io/ocaml-tracing/ocaml-opentelemetry/ci-5.4:latest
eio: true
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- run: chown -R opam:opam .
- name: Build
run: su opam -c "opam exec -- dune build @install -p opentelemetry,opentelemetry-client,opentelemetry-lwt,opentelemetry-cohttp-lwt,opentelemetry-client-ocurl,opentelemetry-client-ocurl-lwt,opentelemetry-client-cohttp-lwt,opentelemetry-logs"
- name: Build eio packages
if: ${{ matrix.eio }}
run: su opam -c "opam exec -- dune build @install -p opentelemetry-client-cohttp-eio"
- name: Lint (protoc check)
run: su opam -c "opam exec -- dune build @lint"
- name: Check no generated files changed
run: git diff --exit-code
- name: Run tests
run: su opam -c "opam exec -- dune build @runtest"