Skip to content

Commit

Permalink
CI(macOS): Cache micromamba environment on same week (#4342)
Browse files Browse the repository at this point in the history
* CI(macOS): Cache micromamba environment on same day

* Use year and week of year for cache key date segment

* Update macos.yml

Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>

---------

Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
  • Loading branch information
echoix and wenzeslaus committed Sep 19, 2024
1 parent 333d8e6 commit 6607e1c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,19 @@ jobs:
# Rehash to forget about the deleted files
hash -r
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Get current date cache key segment
id: date
# Year and week of year so cache key changes weekly
run: echo "date=$(date +%Y-%U)" >> "${GITHUB_OUTPUT}"
- name: Setup Mamba
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1.9.0
with:
init-shell: bash
environment-file: .github/workflows/macos_dependencies.txt
environment-name: grass-env
# Persist on the same period (date).
cache-environment-key: environment-${{ steps.date.outputs.date }}

- name: Environment info
shell: bash -el {0}
run: |
Expand Down

0 comments on commit 6607e1c

Please sign in to comment.