chore: update CI to use ocaml actions v2

This commit is contained in:
Simon Cruanes 2021-11-19 09:48:10 -05:00
parent 0d2cc1c01e
commit 7244b2eb5e
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -1,32 +1,33 @@
name: build name: build
on: [push, pull_request] on:
push:
branches:
- master
pull_request:
branches:
- master
jobs: jobs:
run: run:
name: Build name: Build
strategy: strategy:
matrix: matrix:
os: [macos-latest, ubuntu-latest, windows-latest] os:
ocaml: [ '4.08.0', '4.03.0', '4.11.0' ] - macos-latest
- ubuntu-latest
- windows-latest
ocaml-compiler:
- 4.03.x
- 4.08.x
- 4.12.x
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@main - uses: actions/checkout@v2
- uses: avsm/setup-ocaml@v1 - uses: ocaml/setup-ocaml@v2
with: with:
ocaml-version: ${{ matrix.ocaml }} ocaml-compiler: ${{ matrix.ocaml-compiler }}
- 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 . - run: opam pin -n .
if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam depext -yt iter - run: opam depext -yt iter
if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam install -t . --deps-only - run: opam install -t . --deps-only
if: ${{ matrix.os != 'windows-latest' }} and ${{ steps.cache-opam.outputs.cache-hit != 'true' }}
- run: opam install . --deps-only # no test deps
if: ${{ matrix.os == 'windows-latest' }} and ${{ steps.cache-opam.outputs.cache-hit != 'true' }}
- run: opam exec -- dune build - run: opam exec -- dune build
- run: opam exec -- dune runtest - run: opam exec -- dune runtest
if: ${{ matrix.os != 'windows-latest' }} if: ${{ matrix.os == 'ubuntu-latest'}}