-
Notifications
You must be signed in to change notification settings - Fork 72
46 lines (36 loc) · 1.47 KB
/
indentation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: indentation
on: [ push, pull_request]
jobs:
indentation:
strategy: # remove?
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 4.12.0 # setup-ocaml@v1 does not support 4.12.x for ocaml-version
runs-on: ${{ matrix.os }}
if: ${{ github.event.before != '0000000000000000000000000000000000000000' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
# reuse tests.yml or depend on it to not have to setup OCaml? https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-an-action-in-the-same-repository-as-the-workflow
# rely on cache for now
- name: Cache opam switch # https://github.com/marketplace/actions/cache
uses: actions/cache@v2
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: |
~/.opam
_opam
# Key for restoring and saving the cache
key: opam-ocp-indent-${{ runner.os }}-${{ matrix.ocaml-compiler }}
- name: Set up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-compiler }}
- name: Install ocp-indent
run: opam install -y ocp-indent
- name: Run pre-commit hook on changes since last push
run: git reset --soft ${{ github.event.before }} && eval $(opam env) && ./scripts/hooks/pre-commit