diff --git a/.github/workflows/client-ci.yml b/.github/workflows/client-ci.yml new file mode 100644 index 0000000..fbb5c72 --- /dev/null +++ b/.github/workflows/client-ci.yml @@ -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 diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml new file mode 100644 index 0000000..2ccdf83 --- /dev/null +++ b/.github/workflows/server-ci.yml @@ -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 diff --git a/cn-lsp/server/README.md b/cn-lsp/server/README.md index 76c7aec..1ca6e71 100644 --- a/cn-lsp/server/README.md +++ b/cn-lsp/server/README.md @@ -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: diff --git a/cn-lsp/server/cnlsp.opam b/cn-lsp/server/cnlsp.opam index ba82e13..89e4114 100644 --- a/cn-lsp/server/cnlsp.opam +++ b/cn-lsp/server/cnlsp.opam @@ -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"] ] diff --git a/cn-lsp/server/cnlsp.opam.locked b/cn-lsp/server/cnlsp.opam.locked index 1bb4a15..0ea75fa 100644 --- a/cn-lsp/server/cnlsp.opam.locked +++ b/cn-lsp/server/cnlsp.opam.locked @@ -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"} @@ -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" + ] ] diff --git a/cn-lsp/server/cnlsp.opam.locked-5.1.1 b/cn-lsp/server/cnlsp.opam.locked-5.1.1 deleted file mode 100644 index d3178e0..0000000 --- a/cn-lsp/server/cnlsp.opam.locked-5.1.1 +++ /dev/null @@ -1,94 +0,0 @@ -opam-version: "2.0" -name: "cnlsp" -version: "~dev" -synopsis: "CN Language Server" -description: "A language server protocol implementation for the CN language" -authors: "Sam Cowger" -maintainer: "Sam Cowger" -depends: [ - "base" {= "v0.17.0"} - "base-bigarray" {= "base"} - "base-bytes" {= "base"} - "base-domains" {= "base"} - "base-nnp" {= "base"} - "base-threads" {= "base"} - "base-unix" {= "base"} - "cerberus-lib" {= "281cfc42f"} - "cmdliner" {= "1.3.0"} - "cn" {= "281cfc42f"} - "conf-c++" {= "1.0"} - "conf-findutils" {= "1"} - "conf-gmp" {= "4"} - "conf-python-3" {= "9.0.0"} - "cppo" {= "1.6.9"} - "csexp" {= "1.5.2"} - "dune" {= "3.16.0"} - "dune-configurator" {= "3.15.3"} - "fmt" {= "0.9.0"} - "host-arch-arm64" {= "1"} - "host-system-other" {= "1"} - "jsonrpc" {= "1.17.0"} - "lem" {= "2022-12-10"} - "linol" {= "0.6"} - "linol-lwt" {= "0.6"} - "logs" {= "0.7.0"} - "lsp" {= "1.17.0"} - "lwt" {= "5.7.0"} - "menhir" {= "20231231"} - "menhirCST" {= "20231231"} - "menhirLib" {= "20231231"} - "menhirSdk" {= "20231231"} - "monomorphic" {= "2.1.0"} - "num" {= "1.5"} - "ocaml" {= "5.1.1"} - "ocaml-base-compiler" {= "5.1.1"} - "ocaml-compiler-libs" {= "v0.12.4"} - "ocaml-config" {= "3"} - "ocaml-options-vanilla" {= "1"} - "ocaml_intrinsics_kernel" {= "v0.17.0"} - "ocamlbuild" {= "0.14.3"} - "ocamlfind" {= "1.9.6"} - "ocamlgraph" {= "2.1.0"} - "ocplib-endian" {= "1.2"} - "parsexp" {= "v0.17.0"} - "pprint" {= "20230830"} - "ppx_derivers" {= "1.2.1"} - "ppx_deriving" {= "6.0.2"} - "ppx_sexp_conv" {= "v0.17.0"} - "ppx_yojson_conv_lib" {= "v0.17.0"} - "ppxlib" {= "0.32.1"} - "ppxlib_jane" {= "v0.17.0"} - "result" {= "1.5"} - "seq" {= "base"} - "sexplib" {= "v0.17.0"} - "sexplib0" {= "v0.17.0"} - "sha" {= "1.15.4"} - "stdlib-shims" {= "0.3.0"} - "topkg" {= "1.0.7"} - "trace" {= "0.7"} - "uutf" {= "1.0.3"} - "yojson" {= "2.2.1"} - "z3" {= "4.13.0-1"} - "zarith" {= "1.13"} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -pin-depends: [ - [ - "cerberus-lib.281cfc42f" - "git+ssh://git@github.com/rems-project/cerberus.git#281cfc42f" - ] - ["cn.281cfc42f" "git+ssh://git@github.com/rems-project/cerberus.git#281cfc42f"] -] diff --git a/cn-lsp/server/cnlsp.opam.template b/cn-lsp/server/cnlsp.opam.template index 8a21132..a7a2ed9 100644 --- a/cn-lsp/server/cnlsp.opam.template +++ b/cn-lsp/server/cnlsp.opam.template @@ -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"] ]