commit
2cf8b53069
21
.github/workflows/ci.yaml
vendored
21
.github/workflows/ci.yaml
vendored
@ -13,13 +13,12 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 5 * * TUE"
|
- cron: "0 5 * * TUE"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CACHE_NUMBER: 1 # Change this value to manually reset the environment cache
|
CONDA_CACHE_NUMBER: 1 # Change this value to manually reset the environment cache
|
||||||
|
DATA_CACHE_NUMBER: 1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -67,15 +66,25 @@ jobs:
|
|||||||
activate-environment: pypsa-eur
|
activate-environment: pypsa-eur
|
||||||
use-mamba: true
|
use-mamba: true
|
||||||
|
|
||||||
- name: Set cache date
|
- name: Set cache dates
|
||||||
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
run: |
|
||||||
|
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||||
|
echo "WEEK=$(date +'%Y%U')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Cache data and cutouts folders
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
data
|
||||||
|
cutouts
|
||||||
|
key: data-cutouts-${{ env.WEEK }}-${{ env.DATA_CACHE_NUMBER }}
|
||||||
|
|
||||||
- name: Create environment cache
|
- name: Create environment cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: ${{ matrix.prefix }}
|
path: ${{ matrix.prefix }}
|
||||||
key: ${{ matrix.label }}-conda-${{ hashFiles('envs/environment.yaml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
|
key: ${{ matrix.label }}-conda-${{ hashFiles('envs/environment.yaml') }}-${{ env.DATE }}-${{ env.CONDA_CACHE_NUMBER }}
|
||||||
|
|
||||||
- name: Update environment due to outdated or unavailable cache
|
- name: Update environment due to outdated or unavailable cache
|
||||||
run: mamba env update -n pypsa-eur -f envs/environment.yaml
|
run: mamba env update -n pypsa-eur -f envs/environment.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user