CI: Don't run Mdx and coverage on older versions #497
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" | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: # Check build on various OSes | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
ocaml-compiler: | |
# Don't include every versions. OCaml-CI already covers that | |
- 4.02.x | |
- 4.04.x | |
- 4.14.x | |
include: | |
- os: ubuntu-latest | |
ocaml-compiler: 4.14.x | |
# We don't need to compute coverage for more than one build | |
send-coverage: true | |
# Mdx tests Mdx tests | |
run-mdx: true | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Clone the project | |
- uses: actions/checkout@v2 | |
# Setup | |
- name: Setup OCaml ${{ matrix.ocaml-version }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
# Do not pin odoc to not break Mdx installation | |
opam-pin: false | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
opam-local-packages: | | |
odoc.opam | |
- name: Install dependencies | |
run: opam install -y --deps-only -t ./odoc.opam ./odoc-parser.opam | |
- name: Install bisect_ppx | |
if: matrix.send-coverage == true | |
run: opam install bisect_ppx | |
- name: dune runtest | |
run: opam exec -- dune runtest | |
# Run Mdx tests that are disabled by default. | |
- name: Mdx tests | |
if: matrix.run-mdx == true | |
run: | | |
opam install -y mdx | |
opam exec -- dune build @runmdx | |
- name: Send coverage stats to Coveralls | |
if: matrix.send-coverage == true | |
run: | | |
opam exec -- dune runtest --instrument-with bisect_ppx --force | |
opam exec -- bisect-ppx-report send-to Coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PULL_REQUEST_NUMBER: ${{ github.event.number }} |