Enable Github actions #1
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 and test | ||
on: | ||
- pull_request | ||
- push | ||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- ubuntu-latest | ||
- windows-latest | ||
ocaml-compiler: | ||
- 5.00.x | ||
- 4.13.x | ||
- 4.08.x | ||
- 4.06.x | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Use OCaml ${{ matrix.ocaml-compiler }} | ||
uses: ocaml/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: ${{ matrix.ocaml-compiler }} | ||
- run: opam install . --deps-only --with-doc --with-test | ||
- run: opam exec -- dune build | ||
- run: opam exec -- dune runtest | ||
- name: Upload the build artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.os }}-${{ matrix.ocaml-version }}-world.exe | ||
path: _build/default/world.exe | ||
lint-doc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Use OCaml 4.13.x | ||
uses: ocaml/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: 4.13.x | ||
dune-cache: true | ||
- name: Lint doc | ||
uses: ocaml/setup-ocaml/lint-doc@v2 |