Skip to content

Commit c61c8a3

Browse files
authored
Revert "Revert "Attempt to improve CI caching (#6534)" (#6543)"
This reverts commit 93b8813.
1 parent 93b8813 commit c61c8a3

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
else
7070
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
7171
fi
72+
7273
- name: Cache conda
7374
uses: actions/cache@v3
7475
with:

.github/workflows/ci.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,15 @@ jobs:
8282
8383
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
8484
85+
# This and the next few are based on https://github.com/conda-incubator/setup-miniconda#caching-environments
8586
- name: Cache conda
87+
id: cache-conda
8688
uses: actions/cache@v3
8789
with:
8890
path: ~/conda_pkgs_dir
8991
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
9092
hashFiles('ci/requirements/**.yml') }}
93+
9194
- uses: conda-incubator/setup-miniconda@v2
9295
with:
9396
channels: conda-forge
@@ -98,9 +101,18 @@ jobs:
98101
python-version: ${{ matrix.python-version }}
99102
use-only-tar-bz2: true
100103

104+
- name: Cache conda env
105+
id: cache-env
106+
uses: actions/cache@v3
107+
with:
108+
path: /usr/share/miniconda/envs/xarray-tests
109+
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
110+
hashFiles('ci/requirements/**.yml') }}
111+
101112
- name: Install conda dependencies
102113
run: |
103114
mamba env update -f $CONDA_ENV_FILE
115+
if: steps.cache-env.outputs.cache-hit != 'true'
104116

105117
# We only want to install this on one run, because otherwise we'll have
106118
# duplicate annotations.

0 commit comments

Comments
 (0)