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

caching environment for test routine #33

Closed
wants to merge 4 commits into from
Closed
Changes from all 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
35 changes: 34 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,39 @@ concurrency:
cancel-in-progress: true

jobs:
caching-environment:
name: caching
runs-on: "ubuntu-latest" # FIXME: not sure what it should run on
steps:
- uses: actions/checkout@v2

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true

- name: Get Date
id: get-date
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
shell: bash

- name: Cache Conda env
uses: actions/cache@v2
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('etc/environment-caching.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/environment.yml has not changed
CACHE_NUMBER: 0
id: cache

- name: Update environment
run: mamba env update -n anaconda-client-env -f etc/environment-caching.yml
if: steps.cache.outputs.cache-hit != 'true'

# Look into replacing this with pre-commit.ci
code-quality:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -59,7 +92,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v2 # FIXME: reference cached environment here?
name: Set up conda
with:
# We want to come back and add a previous step (maybe our own github action)
Expand Down