-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 1.67 KB
/
server-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
name: CN Server CI
on:
push:
branches:
- main
pull_request:
branches:
- main
# Cancel in-progress job when a new push is performed
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
ocaml-version: [4.14.1]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
- name: Link lockfile
working-directory: cn-lsp/server
run: ln -s cnlsp.opam.locked-${{ matrix.ocaml-version }} cnlsp.opam.locked
- name: Restore `_opam`
id: cache-opam-restore
uses: actions/cache/restore@v4
with:
path: cn-lsp/server/_opam
key: ${{ matrix.ocaml-version }}-${{ hashFiles('cn-lsp/server/cnlsp.opam.locked') }}
- name: Install server dependencies
working-directory: cn-lsp/server
run: |
opam switch show || opam switch create . ocaml.${{ matrix.ocaml-version }} --deps-only --locked -y
eval $(opam env)
- name: Cache `_opam`
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: cn-lsp/server/_opam
key: ${{ steps.cache-opam-restore.outputs.cache-primary-key }}
- name: Build server
working-directory: cn-lsp/server
run: eval $(opam env) && dune build
- name: Run server tests
working-directory: cn-lsp/server
run: eval $(opam env) && dune test