[develop] Force cycle to be decimal integer (#1213) #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: sd_environment.yml | |
environment-name: srw_sd | |
init-shell: bash | |
cache-downloads: true | |
cache-environment: true | |
- name: Lint the python code | |
run: | | |
micromamba activate srw_sd | |
export PYTHONPATH=$(pwd)/ush | |
pylint --ignore-imports=yes tests/test_python/ | |
pylint ush/create_*.py | |
pylint ush/generate_FV3LAM_wflow.py | |
pylint ush/set_fv3nml*.py | |
pylint ush/update_input_nml.py | |
pylint ush/smoke_dust | |
- name: Checkout externals | |
run: | | |
./manage_externals/checkout_externals ufs-weather-model | |
- name: Run python unittests | |
run: | | |
# exclude test_retrieve_data that is tested in functional test | |
micromamba activate srw_sd | |
export UNIT_TEST=True | |
export PYTHONPATH=$(pwd)/ush | |
# Make dummy directories for fix files so generate_FV3LAM_workflow.py tests complete successfully | |
export CI_FIX_FILES=/home/runner/work | |
mkdir -p $CI_FIX_FILES/fix/fix_am | |
python -m unittest tests/test_python/*.py | |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/tests | |
python -m pytest tests/test_python/test_smoke_dust | |
- name: Run python functional tests | |
run: | | |
micromamba activate srw_sd | |
export CI=true | |
export PYTHONPATH=${PWD}/ush | |
python3 -m unittest tests/test_python/test_retrieve_data.py |