From e152e81d1d2012b5a5a7c7f49b8077027988637c Mon Sep 17 00:00:00 2001 From: Cole Schlesinger <63367934+thatplguy@users.noreply.github.com> Date: Thu, 14 Nov 2024 07:13:57 -0800 Subject: [PATCH] Don't run opam init in CI if cache is present (#99) --- .github/workflows/run-cn-examples.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-cn-examples.yml b/.github/workflows/run-cn-examples.yml index de8935b..469487e 100644 --- a/.github/workflows/run-cn-examples.yml +++ b/.github/workflows/run-cn-examples.yml @@ -37,9 +37,14 @@ jobs: path: ~/.opam key: ${{ matrix.version }} - - name: Setup opam and install dependencies + - name: Setup opam + if: steps.cache-opam-restore.outputs.cache-hit != 'true' + run: opam init --yes --no-setup --shell=sh --compiler=${{ matrix.version }} + + - name: Install dependencies run: | - opam init --yes --no-setup --shell=sh --compiler=${{ matrix.version }} + opam switch ${{ matrix.version }} + eval $(opam env --switch=${{ matrix.version }}) opam install --deps-only --yes ./cerberus.opam ./cerberus-lib.opam ./cn.opam - name: Save cached opam