Skip to content

Commit

Permalink
ci: use switch-based installation/build process for server
Browse files Browse the repository at this point in the history
  • Loading branch information
samcowger committed Nov 12, 2024
1 parent 9688218 commit 4657f5f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,34 @@ jobs:
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: _opam
key: ${{ matrix.ocaml-version }}
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
working-directory: cn-lsp/server
run: |
opam switch create . ocaml.${{ matrix.ocaml-version }} --deps-only --locked -y
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
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
working-directory: cn-lsp/server
run: dune build

- name: Run server tests
working-directory: ./cn-lsp/server
run: |
eval $(opam env)
dune test
working-directory: cn-lsp/server
run: dune test

0 comments on commit 4657f5f

Please sign in to comment.