-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (173 loc) · 4.95 KB
/
Copy pathtests.yaml
File metadata and controls
178 lines (173 loc) · 4.95 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Tests
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
branches: ["main"]
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: test-env
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
create-args: >-
python=3.12
pip
docstring_parser
fsspec
h5netcdf
jinja2
netCDF4
numba
numpy
requests
typer
xarray
pytest
pytest-cov
sympy
beautifulsoup4
pyftpdlib
shapely
geopandas
pyinterp>=2026.4.0
dask
- name: Install python dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
pip install pyasynchat
pip install -e "."
- name: Run unit tests
shell: bash -el {0}
run: |
pytest tests --cov=src/fcollections --cov-report=xml:coverage-ut.xml --cov-report=term
mv .coverage .coverage-ut
- name: Upload unit test coverage artifacts
uses: actions/upload-artifact@v4
with:
name: unit-test-coverage
include-hidden-files: true
path: |
.coverage-ut
coverage-ut.xml
unit_tests_no_geo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: test-env
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
create-args: >-
python=3.12
pip
docstring_parser
fsspec
h5netcdf
jinja2
netCDF4
numba
numpy
requests
typer
xarray
pytest
pytest-cov
sympy
beautifulsoup4
pyftpdlib
shapely
geopandas
pyinterp>=2026.4.0
dask
- name: Install python dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
pip install -e "."
- name: Run unit tests without geo
shell: bash -el {0}
run: |
pytest tests/implementations/collections --ignore tests/implementations/collections/test_area_selector.py --without-geo-packages --cov=src/fcollections --cov-report=xml:coverage-ut-nogeo.xml --cov-report=term
mv .coverage .coverage-ut-nogeo
- name: Upload unit test no-geo coverage artifacts
uses: actions/upload-artifact@v4
with:
name: unit-test-nogeo-coverage
include-hidden-files: true
path: |
.coverage-ut-nogeo
coverage-ut-nogeo.xml
integration_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[testing]"
- name: Run integration tests
run: |
pytest integration_tests --cov=src/fcollections --cov-report=xml:coverage-it.xml --cov-report=term
mv .coverage .coverage-it
- name: Upload integration test coverage artifacts
uses: actions/upload-artifact@v4
with:
name: integration-test-coverage
include-hidden-files: true
path: |
.coverage-it
coverage-it.xml
coverage:
runs-on: ubuntu-latest
needs:
- unit_tests
- unit_tests_no_geo
- integration_tests
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install coverage
run: pip install coverage
- name: Download unit tests coverage artifacts
uses: actions/download-artifact@v4
with:
name: unit-test-coverage
- name: Download unit tests no geo coverage artifacts
uses: actions/download-artifact@v4
with:
name: unit-test-nogeo-coverage
- name: Download integration tests coverage artifacts
uses: actions/download-artifact@v4
with:
name: integration-test-coverage
- name: Combine coverage reports
run: |
coverage combine .coverage-ut .coverage-ut-nogeo .coverage-it
coverage report --fail-under=100
coverage xml
- name: Upload combined coverage report
uses: actions/upload-artifact@v4
with:
name: combined-coverage
path: coverage.xml