From da17dd286c9cbf861188a10db9f0ee9b071d1769 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:17:48 -0800 Subject: [PATCH] Add cache for Micromamba installation This endpoint sometimes fails to resolve, so caching should help. Cache the entire ~/.local/bin folder to keep things simple. --- .github/workflows/ci.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c92c449..47778d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,10 +38,21 @@ jobs: name: build and test (os=${{ matrix.os }}) runs-on: ${{ matrix.os }} steps: + - name: Cache ~/.local/bin + id: cache-local-bin + uses: actions/cache@v4 + with: + path: ~/.local/bin + # Cache should be valid for a maximum of 7 days. + # + key: ${{ runner.os }}-local-bin + - name: Install Micromamba - run: | - curl -fsSL --proto 'https=' https://micro.mamba.pm/install.sh | bash - echo ~/.local/bin >> "$GITHUB_PATH" + if: steps.cache-local-bin.outputs.cache-hit != 'true' + run: curl -fsSL --proto 'https=' https://micro.mamba.pm/install.sh | bash + + - name: Add ~/.local/bin to path + run: echo ~/.local/bin >> "$GITHUB_PATH" - uses: actions/checkout@v3