tests: Coverage improvements #62
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: Build Master in docker | |
on: | |
pull_request: | |
branches: | |
- 'master' | |
push: | |
branches: | |
- 'master' | |
env: | |
OPAMROOT: /home/opam/.opam | |
OPAMYES: true | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
container: | |
image: ocaml/opam:ubuntu-lts-ocaml-4.14 | |
options: --user root # dirty hack | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.11.0 | |
with: | |
access_token: ${{ github.token }} | |
- run: sudo apt-get update -y | |
# checking out the code seems to be important because local switch is used | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # fix me later | |
# - name: Use OCaml ${{ matrix.ocaml-compiler }} | |
# #uses: ocaml/setup-ocaml@v2 | |
# uses: ocaml/setup-ocaml@5319ab427f3840efb109b436a4e6f047dcd9db9f | |
# # working around issue with depext and opam 2.1 | |
# with: | |
# ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
# dune-cache: true | |
- name: Installing dependencies | |
run: | | |
opam pin add zanuda ./ -n | |
opam depext zanuda -y | |
opam install . --deps-only --with-test --with-doc | |
- name: Building... | |
run: | | |
opam exec -- dune build | |
- name: Build API documentation | |
run: opam exec -- dune build @doc | |
- name: Deploy API documentation | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/default/_doc/_html | |
keep_files: true | |
destination_dir: api | |
- run: opam exec -- dune build @install --profile=release | |
- name: Running tests in release... | |
run: | | |
opam exec -- dune test --profile=release | |
- name: Send coverage report to Coveralls | |
if: github.event_name != 'pull_request' | |
run: | | |
git config --global --add safe.directory /__w/zanuda/zanuda | |
opam exec -- make coverage | |
opam exec -- bisect-ppx-report send-to Coveralls --coverage-path $BISECT_DIR | |
env: | |
BISECT_DIR: /tmp/zanudacov | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PULL_REQUEST_NUMBER: ${{ github.event.number }} | |
- name: Build linter descriptions... | |
if: github.event_name != 'pull_request' | |
run: mkdir -p _build/_lintinfo && opam exec -- dune exec zanuda -- -dump-lints _build/_lintinfo/lints.json | |
- name: Deploy linters' descriptions | |
if: github.event_name != 'pull_request' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _build/_lintinfo | |
keep_files: true | |
destination_dir: lints |