diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..48bb50f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +name: Tests + +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + +jobs: + unit-tests: + name: pytest (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: continuous_integration/environment-ci.yml + environment-name: cmac_test_env + create-args: >- + python=${{ matrix.python-version }} + cache-environment: true + + - name: Install cmac + run: pip install --no-deps -e . + + - name: Run unit tests + run: pytest -v cmac/tests/ diff --git a/cmac/tests/test_config.py b/cmac/tests/test_config.py index c9b3a46..508b334 100644 --- a/cmac/tests/test_config.py +++ b/cmac/tests/test_config.py @@ -8,7 +8,7 @@ def test_get_cmac_values(): cmac_config = get_cmac_values('xsapr_i5_ppi') assert type(cmac_config) == dict - assert cmac_config['save_name'] == 'sgpxsaprcmacsurI5.c1' + assert cmac_config['save_name'] == 'sgpxsaprcmacsecI5.c1' assert cmac_config['site_alt'] == 328 assert cmac_config['ref_offset'] == 0.0 assert cmac_config['self_const'] == 60000.00 diff --git a/continuous_integration/environment-ci.yml b/continuous_integration/environment-ci.yml new file mode 100644 index 0000000..080ec91 --- /dev/null +++ b/continuous_integration/environment-ci.yml @@ -0,0 +1,20 @@ +name: cmac_test_env +channels: + - conda-forge + - defaults +dependencies: + - arm_pyart + - cartopy + - cmweather + - coincbc + - cython + - dask + - distributed + - matplotlib + - numpy + - pytest + - scikit-fuzzy + - wradlib + - pip + - pip: + - git+https://github.com/CSU-Radarmet/CSU_RadarTools.git