Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to improve CI caching #6534

Merged
merged 8 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
env:
[
env: [
# Minimum python version:
"py38-bare-minimum",
"py38-min-all-deps",
Expand All @@ -67,12 +66,12 @@ jobs:
else
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
fi

- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ matrix.env }}-${{
key: ${{ runner.os }}-conda-${{ matrix.env }}-${{
hashFiles('ci/requirements/**.yml') }}

- uses: conda-incubator/setup-miniconda@v2
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ jobs:
fi
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV

# This and the next few are based on https://github.com/conda-incubator/setup-miniconda#caching-environments
- name: Cache conda
id: cache-conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
hashFiles('ci/requirements/**.yml') }}

- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
Expand All @@ -74,9 +77,18 @@ jobs:
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true

- name: Cache conda env
id: cache-env
uses: actions/cache@v3
with:
path: ${{ env.CONDA_PREFIX }}
dcherian marked this conversation as resolved.
Show resolved Hide resolved
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
hashFiles('ci/requirements/**.yml') }}

- name: Install conda dependencies
run: |
mamba env update -f $CONDA_ENV_FILE
if: steps.cache-env.outputs.cache-hit != 'true'

- name: Install xarray
run: |
Expand Down