-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (100 loc) · 4.02 KB
/
tests.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Tests
on: push
# Other Github actions to setup conda, not sure which is the best one:
# https://github.com/marketplace/actions/setup-miniconda
# --> seems to work fine
# https://github.com/matthewrmshin/conda-action
# --> No success, how to activate env? Has only 2 stars...
# https://github.com/marketplace/actions/setup-conda
# --> not tested yet
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if env.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('env.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
#mamba-version: "*"
#activate-environment: wind_power_decomposition_usa
#channels: conda-forge
#channel-priority: strict
#environment-file: env.yml
# use Mambaforge to avoid weird conda setup issue:
# https://github.com/conda-incubator/setup-miniconda/issues/116#issuecomment-1384648777
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: wind_power_decomposition_usa
environment-file: env.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- shell: bash -l {0}
run: dvc repro lint
unittest:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/example-environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
#mamba-version: "*"
#activate-environment: wind_power_decomposition_usa
#channels: conda-forge
#channel-priority: strict
#environment-file: env.yml
# use Mambaforge to avoid weird conda setup issue:
# https://github.com/conda-incubator/setup-miniconda/issues/116#issuecomment-1384648777
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: wind_power_decomposition_usa
environment-file: env.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- shell: bash -l {0}
run: dvc repro unit_test_nodep
integrationtests:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/example-environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
#mamba-version: "*"
#activate-environment: wind_power_decomposition_usa
#channels: conda-forge
#channel-priority: strict
#environment-file: env.yml
# use Mambaforge to avoid weird conda setup issue:
# https://github.com/conda-incubator/setup-miniconda/issues/116#issuecomment-1384648777
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: wind_power_decomposition_usa
environment-file: env.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- shell: bash -l {0}
run: dvc repro checks_simulation