Skip to content

Commit

Permalink
cache implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
karkir0003 committed Oct 7, 2023
1 parent b6b7ef2 commit 1c12b7c
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,31 @@ jobs:
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3


- name: Install Mamba Env
- name: Setup Mamba
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: training/environment.yml
miniforge-version: latest
use-mamba: true
activate-environment: dlp

- name: Cache Mamba env
id: cached-mamba-env
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: /usr/share/miniconda3/envs/
key:
mamba-${{ runner.os }}-${{env.CACHE_NUMBER }}-${{hashFiles('**/training/environment.yml') }}

- name: Update environment
run:
mamba env update -n dlp -f
training/environment.yml
if: steps.cached-mamba-env.outputs.cache-hit != 'true'

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
Expand Down Expand Up @@ -85,16 +100,31 @@ jobs:
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3


- name: Install Mamba Env

- name: Setup Mamba
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: training/environment.yml
miniforge-version: latest
use-mamba: true
activate-environment: dlp

- name: Cache Mamba env
id: cached-mamba-env
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: /usr/share/miniconda3/envs/
key:
mamba-${{ runner.os }}-${{env.CACHE_NUMBER }}-${{hashFiles('**/training/environment.yml') }}

- name: Update environment
run:
mamba env update -n dlp -f
training/environment.yml
if: steps.cached-mamba-env.outputs.cache-hit != 'true'

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
Expand Down

0 comments on commit 1c12b7c

Please sign in to comment.