Skip to content

Commit

Permalink
Add cache for Micromamba installation
Browse files Browse the repository at this point in the history
This endpoint sometimes fails to resolve, so caching should help. Cache
the entire ~/.local/bin folder to keep things simple.
  • Loading branch information
victorlin committed Jan 17, 2024
1 parent 4c25ecf commit da17dd2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
# <https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy>
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

Expand Down

0 comments on commit da17dd2

Please sign in to comment.