Skip to content

Commit

Permalink
try to cache opam
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Feb 13, 2024
1 parent 8ee1b98 commit af42160
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
- name: cache
id: cache-opam
uses: actions/cache@v3
env:
cache-name: cache-opam
with:
path: |
owi/_opam/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.opam') }}
- name: setup-ocaml
uses: ocaml/setup-ocaml@v2
with:
Expand All @@ -33,7 +42,11 @@ jobs:
opam-depext: true
opam-pin: true
allow-prerelease-opam: true
- name: depext
run: |
opam depext -y owi
- name: setup
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
opam install -y ./*.opam --deps-only --with-test --with-doc
- name: build
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ jobs:
with:
submodules: recursive
persist-credentials: false
- name: cache
id: cache-opam
uses: actions/cache@v3
env:
cache-name: cache-opam
with:
path: |
owi/_opam/
key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/*.opam') }}
- name: setup-ocaml
uses: ocaml/setup-ocaml@v2
with:
Expand All @@ -20,13 +29,16 @@ jobs:
opam-depext: true
opam-pin: true
allow-prerelease-opam: true
- name: depext
run: |
opam depext -y owi
- name: setup-deploy
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
opam install -y ./*.opam --deps-only --with-test --with-doc
opam install -y ./*.opam --deps-only --with-test --with-doc
touch doc/.nojekyll
- name: api
run: |
touch doc/.nojekyll
opam exec -- dune build @doc
mv _build/default/_doc/_html doc/api
- name: coverage
Expand Down

0 comments on commit af42160

Please sign in to comment.