diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bd7abbf..9a1a11a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -49,3 +49,37 @@ jobs: - run: opam install --deps-only --with-doc --with-test . - run: opam exec -- dune build - run: opam exec -- dune runtest + + coverage: + name: Coverage + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ocaml-compiler: + - 4.14.x + steps: + - uses: actions/checkout@v3 + - name: Use OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + opam-local-packages: lev.opam lev-fiber.opam lev-fiber-csexp.opam + + - name: Set git user + run: | + git config --global user.name github-actions[bot] + git config --global user.email github-actions[bot]@users.noreply.github.com + + - name: Install deps + run: | + opam install . --deps-only --with-doc --with-test + opam install bisect_ppx + - name: Run and send coverage + run: | + opam exec -- dune build --instrument-with bisect_ppx --force @runtest + opam exec -- bisect-ppx-report send-to Coveralls + continue-on-error: true + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PULL_REQUEST_NUMBER: ${{ github.event.number }} diff --git a/lev-fiber-csexp/src/dune b/lev-fiber-csexp/src/dune index d5393c5..8749ef3 100644 --- a/lev-fiber-csexp/src/dune +++ b/lev-fiber-csexp/src/dune @@ -1,4 +1,6 @@ (library (name lev_fiber_csexp) (public_name lev-fiber-csexp) - (libraries fiber csexp stdune dyn lev_fiber)) + (libraries fiber csexp stdune dyn lev_fiber) + (instrumentation + (backend bisect_ppx))) diff --git a/lev-fiber/src/dune b/lev-fiber/src/dune index ce42a4f..e88e82b 100644 --- a/lev-fiber/src/dune +++ b/lev-fiber/src/dune @@ -7,4 +7,6 @@ (public_name lev-fiber) (instrumentation (backend bisect_ppx)) - (libraries unix dyn stdune threads.posix fiber lev lev_fiber_util)) + (libraries unix dyn stdune threads.posix fiber lev lev_fiber_util) + (instrumentation + (backend bisect_ppx))) diff --git a/lev/src/dune b/lev/src/dune index e62d999..2faecee 100644 --- a/lev/src/dune +++ b/lev/src/dune @@ -24,4 +24,6 @@ (backend bisect_ppx)) (foreign_stubs (language c) - (names lev_stubs))) + (names lev_stubs)) + (instrumentation + (backend bisect_ppx)))