11# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33
4- name : Python package
4+ name : Run pytests
55
66on :
77 push :
1010 branches : [ "master" ]
1111
1212jobs :
13- build :
13+ test :
1414
1515 runs-on : ubuntu-latest
1616 strategy :
@@ -19,31 +19,30 @@ jobs:
1919 python-version : ["3.9", "3.10", "3.11", "3.12"]
2020
2121 steps :
22- - uses : actions/checkout@v3
22+ - uses : actions/checkout@v4
2323 - name : Set up Python ${{ matrix.python-version }}
24- uses : actions/setup-python@v3
24+ uses : actions/setup-python@v5
2525 with :
2626 python-version : ${{ matrix.python-version }}
27- - name : Install dependencies
28- run : |
29- "${SHELL}" <(curl -L micro.mamba.pm/install.sh)
30- eval "$(micromamba shell hook --shell bash)"
31- micromamba activate base
32- micromamba install pytest-cov pytest-mpl xarray netcdf4 pandas numpy scikit-learn scipy pyproj cartopy metpy ipywidgets python=${{ matrix.python-version }} -c conda-forge
33- python -m pip install .
27+ - name : Install environment with micromamba
28+ uses : mamba-org/setup-micromamba@v1
29+ with :
30+ environment-file : tests/test-env.yml
31+ create-args : python=${{ matrix.python-version }}
32+ init-shell : bash
3433 - name : Test with pytest
3534 run : |
3635 eval "$(micromamba shell hook --shell bash)"
37- micromamba activate base
36+ micromamba activate pyxlma-tests
3837 coverage run --source=pyxlma -m pytest --mpl --mpl-baseline-path=tests/truth/images/ --mpl-generate-summary=html,json --mpl-results-path=tests/mpl-results/ tests/
3938 coverage xml
4039 - name : Upload coverage reports to Codecov
41- uses : codecov/codecov-action@v3
40+ uses : codecov/codecov-action@v4
4241 env :
4342 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
4443 - name : Upload matplotlib test results
4544 if : always()
46- uses : actions/upload-artifact@v3
45+ uses : actions/upload-artifact@v4
4746 with :
48- name : matplotlib-results
47+ name : matplotlib-results-${{ matrix.python-version }}
4948 path : tests/mpl-results/
0 commit comments