forked from pypsa-meets-earth/pypsa-earth
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 1.91 KB
/
ci-mac.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CI-mac
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 5 * * TUE"
env:
CACHE_NUMBER: 1 # Change this value to manually reset the environment cache
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
label: macos-latest
prefix: /Users/runner/miniconda3/envs/pypsa-earth
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
# - name: Add solver to environment
# run: |
# echo -e "- glpk\n- ipopt<3.13.3" >> envs/environment.yaml
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: pypsa-earth
use-mamba: true
- name: Create environment cache
uses: actions/cache@v2
id: cache
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('envs/environment.yaml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
- name: Update environment due to outdated or unavailable cache
if: steps.cache.outputs.cache-hit != 'true'
run: mamba env update -n pypsa-earth -f envs/environment.yaml
- name: Conda list
run: |
conda list
- name: Create test configs
run: |
snakemake --cores all build_test_configs
- name: Test tutorial workflow
run: |
cp test/tmp/config.tutorial_noprogress_tmp.yaml config.yaml
snakemake --cores all solve_all_networks
# - name: Test plotting and summaries
# run: |
# snakemake --cores all plot_all_p_nom
# snakemake --cores all plot_all_summaries
# snakemake --cores all make_all_summaries
# rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results