Main workflow #160
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: Main workflow | |
on: | |
pull_request: | |
push: | |
schedule: | |
- cron: 0 1 * * MON | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
# We test: | |
# - once for each architecture with the latest OCaml | |
# - once for a few older versions of OCaml under Linux | |
os: [macos-11, macos-12, ubuntu-latest, windows-latest] | |
ocaml: [4.14.0] | |
include: | |
- {os: ubuntu-latest, ocaml: 4.13.1} | |
- {os: ubuntu-latest, ocaml: 4.10.0} | |
- {os: ubuntu-latest, ocaml: 4.09.1} | |
- {os: ubuntu-latest, ocaml: 4.08.1} | |
# Allow tests to fail on Windows (ppx_expect is broken): | |
- {os: windows-latest, allow-failure: true} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup OCaml ${{ matrix.ocaml-version }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
cache-prefix: v1-${{ matrix.os }}-${{ matrix.ocaml }} | |
dune-cache: true | |
ocaml-compiler: ${{ matrix.ocaml }} | |
- name: Build dependencies | |
run: opam exec -- ocaml .github/workflows/ci.ml build | |
- name: Run test suite | |
run: opam exec -- ocaml .github/workflows/ci.ml test | |
continue-on-error: ${{ matrix.allow-failure || false }} | |
Format: | |
strategy: | |
matrix: | |
include: | |
- ocaml: 4.13.1 | |
os: ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup OCaml ${{ matrix.ocaml }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
cache-prefix: v1-${{ matrix.os }}-${{ matrix.ocaml }} | |
dune-cache: true | |
ocaml-compiler: ${{ matrix.ocaml }} | |
- name: Check that source is well formatted | |
uses: ocaml/setup-ocaml/lint-fmt@v2 |