Skip to content

Commit 6f81a91

Browse files
committed
fix with.path cache argument
1 parent 0e8034d commit 6f81a91

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

.github/workflows/test_quick.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
- main
88
workflow_dispatch:
99

10-
env:
11-
CACHE_NUMBER: 0 # increase to reset cache manually
12-
1310
jobs:
1411
basic-testing:
1512
runs-on: ${{matrix.os}}
@@ -25,6 +22,8 @@ jobs:
2522
- name: Git clone
2623
uses: actions/checkout@v3
2724

25+
# See caching environments
26+
# https://github.com/conda-incubator/setup-miniconda#caching-environments
2827
- name: Setup Mambaforge
2928
uses: conda-incubator/setup-miniconda@v2
3029
with:
@@ -33,13 +32,22 @@ jobs:
3332
activate-environment: env_qolmat_ci
3433
use-mamba: true
3534

36-
- name: Set cache date
37-
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
35+
- name: Get Date
36+
id: get-date
37+
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
3838

39-
- uses: actions/cache@v2
39+
- name: Cache Conda env
40+
uses: actions/cache@v2
4041
with:
41-
path: ${{ matrix.prefix }}
42-
key: ${{ matrix.label }}-conda-${{ hashFiles('environment.ci.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
42+
path: ${{ env.CONDA }}/envs
43+
key:
44+
conda-${{ runner.os }}--${{ runner.arch }}--${{
45+
steps.get-date.outputs.today }}-${{
46+
hashFiles('environment.ci.yml') }}-${{ env.CACHE_NUMBER
47+
}}
48+
env:
49+
# Increase this value to reset cache if environment.ci.yml has not changed
50+
CACHE_NUMBER: 0
4351
id: cache
4452

4553
- name: Update environment

0 commit comments

Comments
 (0)