ocaml-containers/.github/workflows/main.yml
2020-12-21 17:41:18 -05:00

32 lines
1 KiB
YAML

name: build
on: [push, pull_request]
jobs:
run:
name: Build
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
ocaml: [ '4.08.0', '4.03.0', '4.11.0' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@main
- uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml }}
- name: cache opam
id: cache-opam
uses: actions/cache@v2
with:
path: _opam
key: opam-${{matrix.operating-system}}-${{matrix.ocaml-version}}
- run: opam pin -n .
if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam depext -yt containers containers-data containers-thread
if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam install -t . --deps-only
if: ${{ matrix.os != 'windows-latest' }}
- run: opam install . --deps-only # no test deps
if: ${{ matrix.os == 'windows-latest' }}
- run: opam exec -- dune build
- run: opam exec -- dune runtest
if: ${{ matrix.os != 'windows-latest' }}