-
Notifications
You must be signed in to change notification settings - Fork 27
139 lines (120 loc) · 3.84 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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<1
numpy<2
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
test_latest:
needs: linting
name: Test latest dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
environment-name: test
create-args: >-
python=3.10
proj
libgdal
cython
netcdf4
- name: Install Env
shell: bash
run: |
micromamba run -n test python -m pip install \
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
--no-deps --pre --upgrade \
numpy \
pandas \
scipy;
micromamba run -n test python -m pip install --upgrade \
git+https://github.com/geopandas/pyogrio.git@main \
git+https://github.com/rasterio/rasterio.git@main \
git+https://github.com/pyproj4/pyproj.git@main \
git+https://github.com/geopandas/geopandas.git@main \
git+https://github.com/pydata/xarray.git@main \
git+https://github.com/opendatacube/odc-geo.git@develop \
git+https://github.com/corteva/rioxarray.git@master;
micromamba run -n test python -m pip install -e .[all]
micromamba run -n test python -m pip install -r requirements/test.txt
- 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: Test
shell: bash
run: |
micromamba run -n test pytest --cov-report term-missing --cov=geocube --cov-report xml