forked from rems-project/sail
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.28 KB
/
formatting.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
47
48
49
50
51
52
name: Check formatting
on: [push, pull_request, workflow_dispatch]
env:
OPAMVERBOSE: 1
jobs:
build:
# GitHub allows matrix variables in more places than env variables
strategy:
matrix:
version: [5.0.0]
os: [ubuntu-latest]
fmt: [0.26.0]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: System dependencies
run: |
sudo apt install build-essential libgmp-dev z3 cvc4 opam
- name: Restore cached opam
id: cache-opam-restore
uses: actions/cache/restore@v3
with:
path: ~/.opam
key: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.fmt }}-fmt
- name: Setup opam
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
run: |
opam init --yes --no-setup --shell=sh --compiler=${{ matrix.version }}
eval $(opam env)
opam install "ocamlformat=${{ matrix.fmt }}" --yes
- name: Save cached opam
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
id: cache-opam-save
uses: actions/cache/save@v3
with:
path: ~/.opam
key: ${{ steps.cache-opam-restore.outputs.cache-primary-key }}
- name: Format Sail
run: |
eval $(opam env)
dune fmt
git diff-index --quiet HEAD --