-
-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache conda environment between CI test runs (#6855)
- Loading branch information
1 parent
6da758b
commit 7f83c7b
Showing
1 changed file
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ jobs: | |
# run: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | ||
|
||
env: | ||
CONDA_FILE: continuous_integration/environment-${{ matrix.python-version }}.yaml | ||
TEST_ID: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.partition-label }} | ||
# TEST_ID: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.partition-label }}-${{ matrix.run }} | ||
|
||
|
@@ -60,14 +61,39 @@ jobs: | |
miniforge-version: latest | ||
condarc-file: continuous_integration/condarc | ||
use-mamba: true | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: continuous_integration/environment-${{ matrix.python-version }}.yaml | ||
activate-environment: dask-distributed | ||
|
||
- name: Show conda options | ||
shell: bash -l {0} | ||
run: conda config --show | ||
|
||
- name: Check if caching is enabled | ||
uses: xarray-contrib/[email protected] | ||
id: skip-caching | ||
with: | ||
keyword: "[skip-caching]" | ||
|
||
- name: Get Date | ||
if: steps.skip-caching.outputs.trigger-found != 'true' | ||
id: get-date | ||
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" | ||
shell: bash | ||
|
||
- name: Cache Conda env | ||
if: steps.skip-caching.outputs.trigger-found != 'true' | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.CONDA }}/envs | ||
key: conda-${{ matrix.os }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }} | ||
env: | ||
# Increase this value to reset cache if continuous_integration/environment-${{ matrix.python-version }}.yaml has not changed | ||
CACHE_NUMBER: 0 | ||
id: cache | ||
|
||
- name: Update environment | ||
run: mamba env update -n dask-distributed -f ${{ env.CONDA_FILE }} | ||
if: steps.skip-caching.outputs.trigger-found == 'true' || steps.cache.outputs.cache-hit != 'true' | ||
|
||
- name: Install | ||
shell: bash -l {0} | ||
run: | | ||
|