Skip to content

Commit

Permalink
ci: cache/restore opam dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
samcowger committed Nov 1, 2024
1 parent a0f90de commit 7b14f51
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,29 @@ jobs:
uses: actions/checkout@v4

- name: Set up OCaml
uses: ocaml/setup-ocaml@v2
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: opam install . --deps-only --locked -y
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
Expand Down

0 comments on commit 7b14f51

Please sign in to comment.