Skip to content

Set up CI

Set up CI #6

Workflow file for this run

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@v2
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
- name: Restore cached ~/.opam
id: cache-opam-restore
uses: actions/cache/restore@v4
with:
path: ~/.opam
key: ${{ matrix.ocaml-version }}
- name: Install server dependencies
working-directory: ./cn-lsp/server
run: opam install . --deps-only --locked -y
- name: Cache ~/.opam
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
id: cache-opam-save
uses: actions/cache/save@v4
with:
path: ~/.opam
key: ${{ steps.cache-opam-restore.outputs.cache-primary-key }}
- name: Build server
working-directory: ./cn-lsp/server
run: |
echo 1
eval $(opam env)
echo 2
which dune
dune build
echo 3
- name: Run server tests
working-directory: ./cn-lsp/server
run: |
eval $(opam env)
dune test