Skip to content

Commit 8cf9e57

Browse files
max-sixtydcherianpre-commit-ci[bot]
authored
Attempt to improve CI caching (#6534)
* Attempt to improve CI caching Currently about 40% of the time is taken by installing things, hopefully we can cut that down * Update .github/workflows/ci.yaml Co-authored-by: Deepak Cherian <[email protected]> * Update .github/workflows/ci.yaml * Fix some mypy issues (#6531) * Fix some mypy issues Unfortunately these have crept back in. I'll add a workflow job, since the pre-commit is not covering everything on its own * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add mypy workflow * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Revert "Update .github/workflows/ci.yaml" This reverts commit 73a9932. * hard-code env path Co-authored-by: Deepak Cherian <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1c79018 commit 8cf9e57

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)