forked from ufs-community/ufs-srweather-app
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.5 KB
/
python_tests.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
name: Python Tests
on:
push:
branches:
- develop
- 'release/*'
pull_request:
branches:
- develop
- 'release/*'
workflow_dispatch:
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
srw_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Micromamba and srw_app environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: srw_app
init-shell: bash
cache-downloads: true
cache-environment: true
- name: Checkout externals
run: |
./manage_externals/checkout_externals ufs-weather-model
- name: Lint the python code
run: |
micromamba activate srw_app
export PYTHONPATH=$(pwd)/ush
pylint --ignore-imports=yes tests/test_python/
pylint ush/create_*.py
pylint ush/generate_FV3LAM_wflow.py
- name: Run python unittests
run: |
# exclude test_retrieve_data that is tested in functional test
micromamba activate srw_app
export UNIT_TEST=True
export PYTHONPATH=$(pwd)/ush
python -m unittest -b tests/test_python/*.py
- name: Run python functional tests
run: |
micromamba activate srw_app
export CI=true
export PYTHONPATH=${PWD}/ush
python3 -m unittest -b tests/test_python/test_retrieve_data.py