-
Notifications
You must be signed in to change notification settings - Fork 10
72 lines (59 loc) · 1.61 KB
/
ci.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
build:
name: Build and test on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-20.04
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: "Windows: Set git to use LF"
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Use OCaml 4.14.0
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.0
opam-pin: false
opam-depext: false
- name: OPAM install
run: opam install . --deps-only --with-test
- name: Check format
run: opam exec -- dune build @fmt
- name: Build
run: opam exec -- dune build
- name: Test
run: opam exec -- dune runtest
- name: (release only) Get artifact
id: get_artifact
if: github.event_name != 'pull_request'
run: node .github/workflows/get_artifact.js
- name: (release only) Upload artifact ${{ matrix.os }}
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v2
with:
name: ${{ steps.get_artifact.outputs.artifact_name }}
path: ${{ steps.get_artifact.outputs.exe_name }}