Skip to content

Commit

Permalink
simplify github action
Browse files Browse the repository at this point in the history
  • Loading branch information
art-w committed Apr 13, 2024
1 parent e68e347 commit 8ce2908
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/coverage.yml
Expand Up @@ -18,7 +18,6 @@ jobs:
matrix:
os:
- ubuntu-latest
packages: [ '.' ]
ocaml-compiler:
- 5.1.x

Expand All @@ -31,37 +30,21 @@ jobs:
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-local-packages: $${ matrix.opam-local-packages }}
opam-depext-flags: --with-test

- name: Pin local packages
run: |
# Pin all local opam files to avoid internal conflicts
#
# TODO: replace with `opam pin --with-version` when Opam 2.1 is
# available via `setup-ocaml`.
opam exec -- ocamlc -config
find . -maxdepth 1 -name '*.opam' -printf '%P\n' |\
cut -d. -f1 |\
xargs -I{} -n 1 opam pin add {}.dev ./ -n
- name: Install depexts
run: |
find . -maxdepth 1 -name '*.opam' -printf '%P\n' |\
cut -d. -f1 |\
xargs opam depext --update -y

- name: Install Opam dependencies
run: opam install ${{ matrix.packages }} --with-test --deps-only
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 --verbose --instrument-with bisect_ppx
run: opam exec -- dune runtest --instrument-with bisect_ppx

- name: Send coverage report to Codecov
run: opam exec -- bisect-ppx-report send-to Codecov
Expand Down

0 comments on commit 8ce2908

Please sign in to comment.