add ocamlformat github action #1
Workflow file for this run
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: ocamlformat | |
on: [push, pull_request] | |
jobs: | |
format: | |
name: ocamlformat | |
strategy: | |
fail-fast: false | |
matrix: | |
ocaml-version: ["4.14.2"] | |
operating-system: [ubuntu-latest] | |
runs-on: ${{ matrix.operating-system }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Use OCaml ${{ matrix.ocaml-version }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-version }} | |
- name: Install ocamlformat | |
run: opam install ocamlformat | |
- name: Format code | |
run: | | |
find . -name \*\.ml | xargs ocamlformat --inplace | |
git diff --quiet | |
- name: Build | |
run: | | |
opam install -y mirage | |
mirage configure -t hvt | |
make |