forked from dbuenzli/brr
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (76 loc) · 2.36 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
check:
strategy:
fail-fast: false
matrix:
ocaml-version:
- 4.13.1
runs-on: ubuntu-latest
container:
image: ghcr.io/kxcteam/ocaml-general:${{ matrix.ocaml-version }}
timeout-minutes: 25
steps:
- name: Checkout code
uses: actions/checkout@v3
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
- name: Set safe directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Initialize submodules
run: git submodule update --init
- name: Check OCaml version and workspace info
run: ./scripts/ci_print_env.sh
- name: Install OPAM dependencies
run: |
opam uninstall -y brr
opam install -y . --deps-only --with-test || (opam update && opam install -y . --deps-only --with-test)
- name: Perform dune build
run: opam exec -- dune build
- name: Perform dune runtest
run: opam exec -- dune runtest
matrix-check:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-version:
- 4.08.1
- 4.13.1
- 4.14.0
- 5.0.0
node-version:
# - lts/fermium # v14 Maintenance LTS
- lts/gallium # v16 Active LTS
# - lts/hydrogen # v18 Active LTS
if: github.event.pull_request.draft == false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 2
- name: Use OCaml ${{ matrix.ocaml-version }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
- name: Cache OPAM switch
id: cache-switch
uses: actions/cache@v3
with:
path: _opam
key: v1-${{ runner.os }}-${{ matrix.ocaml-version }}-opam-switch
- name: Check OCaml version and workspace info
run: ./scripts/ci_print_env.sh
- name: Install dependencies
run: opam install -y . --deps-only --with-test
- name: Perform dune build
run: opam exec -- dune build
- name: Perform dune runtest
run: opam exec -- dune runtest