From de21dbc57922a46fa01fccd2e868a6c32143f2b5 Mon Sep 17 00:00:00 2001 From: Cole Schlesinger Date: Wed, 13 Nov 2024 14:25:03 -0800 Subject: [PATCH] Don't run opam init in CI if cache is present --- .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