coverage #2215
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: coverage | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
# Prime the caches every Monday | |
- cron: 0 1 * * MON | |
jobs: | |
build: | |
if: github.repository_owner == 'mirage' | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
ocaml-compiler: | |
- 5.1.x | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set git to use LF | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use OCaml ${{ matrix.ocaml-compiler }} | |
uses: ocaml/setup-ocaml@v3 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
- name: Install Opam dependencies | |
run: opam install . --with-test --deps-only | |
- name: Build | |
run: opam exec -- dune build | |
- name: Run tests with coverage instrumentation | |
run: opam exec -- dune runtest --instrument-with bisect_ppx | |
- name: Send coverage report to Codecov | |
run: opam exec -- bisect-ppx-report send-to Codecov --verbose | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
PULL_REQUEST_NUMBER: ${{ github.event.number }} |