-
Notifications
You must be signed in to change notification settings - Fork 167
86 lines (72 loc) · 2.62 KB
/
test-notebooks.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
# (C) Copyright 2021 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.
#
name: Test Notebooks
on:
push: {}
workflow_dispatch: {}
# pull_request: {}
jobs:
# quality:
# name: Code QA
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: pip install black flake8 isort
# - run: black --version
# - run: isort --version
# - run: flake8 --version
# - run: isort --check .
# - run: black --check .
# - run: flake8 .
checks:
strategy:
fail-fast: false
matrix:
# platform: ["ubuntu-latest", "macos-latest", "windows-latest"]
# python-version: ["3.8", "3.9", "3.10"]
platform: ["ubuntu-latest"]
python-version: ["3.9"]
module: [ "tier_2/data_handling", "tier_2/deep_learning", "tier_2/physic_informed", "tier_2/regression_decision_trees", "tier_2/uncertainty", "tier_3/data_assimilation", "tier_3/forecast_model", "tier_3/observations", "tier_3/ocean_climate", "tier_3/operational_meteorology", "tier_3/post_processing" ]
name: ${{ matrix.module }} notebooks testing
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Tokens
shell: python
env:
ECMWFAPIRC: ${{ secrets.ECMWFAPIRC }}
CDSAPIRC: ${{ secrets.CDSAPIRC }}
run: |
import os
for n in ('ECMWFAPIRC', 'CDSAPIRC'):
m = os.path.expanduser("~/." + n.lower())
if os.environ[n]:
with open(m, "w") as f:
print(os.environ[n], file=f)
- name: Install requirements
run: |
pip install tensorflow
pip install tensorflow-probability
pip install scikit-learn scipy
pip install h5py
pip install matplotlib pandas numpy netCDF4 seaborn
pip install climetlab
pip install -e tier_2/data_handling/climetlab-my-plugin-solution
pip freeze
- name: Install test tools
run: |
pip install pytest nbformat nbconvert ipykernel
pip freeze
pwd
- name: Test notebooks
working-directory: ${{ matrix.module }}
run: pytest -vv ../../tests/test_notebooks.py