Tests #440
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: Tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '0 0 * * 0' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- uses: pre-commit/[email protected] | |
test: | |
needs: linting | |
name: ${{ matrix.os }}, ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Conda | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
init-shell: bash | |
environment-name: test | |
create-args: >- | |
python=${{ matrix.python-version }} | |
geopandas | |
netcdf4 | |
odc-geo | |
pandoc | |
rasterio | |
rioxarray | |
scipy | |
xarray | |
- name: Install Env | |
shell: bash | |
run: | | |
micromamba run -n test python -m pip install -r requirements/dev.txt | |
micromamba run -n test python -m pip install -e . | |
- name: Check and Log Environment | |
shell: bash | |
run: | | |
micromamba run -n test python -V | |
micromamba run -n test python -c "import geocube; geocube.show_versions();" | |
micromamba info | |
- name: Pylint | |
shell: bash | |
run: | | |
micromamba run -n test python -m pylint geocube | |
- name: mypy | |
shell: bash | |
run: | | |
micromamba run -n test python -m mypy geocube/ | |
- name: Test | |
shell: bash | |
run: | | |
micromamba run -n test pytest --cov-report term-missing --cov=geocube --cov-report xml | |
- name: Test Build docs | |
shell: bash | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
micromamba run -n test sphinx-build -b html docs/ docs/_build/ | |
- uses: codecov/codecov-action@v4 |