Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CI #123

Merged
merged 7 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/client-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CN Client 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:
node-version: [21.7.3]
os: [ubuntu-22.04]

runs-on: ${{ matrix.os }}

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install client dependencies
working-directory: ./cn-lsp/client
run: npm install

- name: Build client
working-directory: ./cn-lsp/client
run: npm run compile
64 changes: 64 additions & 0 deletions .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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: Restore `_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: |
eval $(opam env)
opam install . --deps-only --locked -y

- name: Cache `_opam`
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
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: |
eval $(opam env)
dune build

- name: Run server tests
working-directory: ./cn-lsp/server
run: |
eval $(opam env)
dune test
4 changes: 2 additions & 2 deletions cn-lsp/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Begin by installing OCaml and opam, if need be - here are
[instructions](https://ocaml.org/docs/installing-ocaml) for how to do so. CN and
Cerberus currently recommend, and build with, OCaml 4.14.1, and that version was
used to generate the lockfile which this installation process relies on. (I've
also been able to work with other versions as recent as 5.1.1, and have included
an alternate lockfile for 5.1.1 as well, but your mileage may vary.)
also been able to work with other versions as recent as 5.1.1, but your mileage
may vary.)

I recommend creating and using an opam switch to maintain an isolated dependency
installation and development environment:
Expand Down
9 changes: 6 additions & 3 deletions cn-lsp/server/cnlsp.opam
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ build: [
pin-depends: [
[
"cerberus.f1f118b26"
"git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
[
"cerberus-lib.f1f118b26"
"git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
[
"cn.f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
["cn.f1f118b26" "git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"]
]
20 changes: 9 additions & 11 deletions cn-lsp/server/cnlsp.opam.locked
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ depends: [
"dune" {= "3.16.0"}
"dune-configurator" {= "3.16.0"}
"fmt" {= "0.9.0"}
"host-arch-arm64" {= "1"}
"host-system-other" {= "1"}
"jsonrpc" {= "1.17.0"}
"lem" {= "2022-12-10"}
"linol" {= "0.6"}
Expand Down Expand Up @@ -86,15 +84,15 @@ build: [
]
pin-depends: [
[
"cerberus.f1f118b26"
"git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"
]
"cerberus.f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
[
"cerberus-lib.f1f118b26"
"git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"
]
"cerberus-lib.f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
[
"cn.f1f118b26"
"git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"
]
"cn.f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
]
94 changes: 0 additions & 94 deletions cn-lsp/server/cnlsp.opam.locked-5.1.1

This file was deleted.

9 changes: 6 additions & 3 deletions cn-lsp/server/cnlsp.opam.template
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
pin-depends: [
[
"cerberus.f1f118b26"
"git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
[
"cerberus-lib.f1f118b26"
"git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
[
"cn.f1f118b26"
"git+https://github.com/rems-project/cerberus.git#f1f118b26"
]
["cn.f1f118b26" "git+ssh://git@github.com/rems-project/cerberus.git#f1f118b26"]
]