From af42160d8a6719ede47ecc2a5d5c1861cb97783e Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 13 Feb 2024 13:57:00 +0100 Subject: [PATCH] try to cache opam --- .github/workflows/build.yml | 13 +++++++++++++ .github/workflows/deploy.yml | 16 ++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bb63e922..6da5d9bb8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 34bbbafd9..ba581cef7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: @@ -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