Skip to content

ADD: short course section in user guide #108

ADD: short course section in user guide

ADD: short course section in user guide #108

name: Test pyrad mch
env:
MINIMAL_DEPENDENCIES: Cython numpy cartopy
TEST_DEPENDENCIES: pytest imageio pygrib gdal
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
unit_tests:
name: Unit Tests (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest"]
python-version: [ "3.9", "3.10", "3.11", "3.12"]
max-parallel: 6
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
ref : master
- name: Clone pyrad-tests
uses: actions/checkout@main
with:
repository: MeteoSwiss/pyrad-tests
path: pyrad-tests
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: flexible
activate-environment: test-environment
- name: Install dependencies
env:
PACKAGES: ${{env.MINIMAL_DEPENDENCIES}} ${{env.OPTIONAL_DEPENDENCIES}} ${{env.TEST_DEPENDENCIES}}
PYRAD_TESTS_PATH: ${{github.workspace}}/pyrad-tests/
run: |
conda install -c conda-forge ${{env.PACKAGES}}
pip install wradlib
- name: Install pyart
if: matrix.os != 'macos-latest'
working-directory: ${{github.workspace}}/src/pyart/
run: python -m pip install .
- name: Install pyrad
if: matrix.os != 'macos-latest'
working-directory: ${{github.workspace}}/src/pyrad_proc/
run: python -m pip install .
- name: Install DX50 lib
working-directory: ${{github.workspace}}/src/libDX50/
run: make
- name: Check imports
working-directory: ${{github.workspace}}/pyrad-tests/
run: |
python -c "import pyrad; print(pyrad.__file__)"
python -c "from pyrad.flow import main"
- name: Run tests
env:
PYRAD_TESTS_PATH: ${{github.workspace}}/pyrad-tests/
PSRLIB_PATH: ${{github.workspace}}/src/libDX50/lib/
PYART_CONFIG: ${{github.workspace}}/config/pyart/mch_config.py
working-directory: ${{github.workspace}}/pyrad-tests//
run: pytest "run_tests.py::test_mch"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}