File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 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 :
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments