Skip to content

Commit 7da0fc0

Browse files
committed
change gh actions
1 parent ef34c39 commit 7da0fc0

3 files changed

Lines changed: 41 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ jobs:
7777

7878
- name: Download models
7979
run: |
80-
pytest -m "not repro and load_model" -n auto --max-worker-restart=0
80+
pytest -m "not repro and load_model" -n auto
8181
8282
- name: Run standard tests
8383
run: |
84-
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto --max-worker-restart=0
84+
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto
8585
8686
- name: Run LiteRT tests
8787
run: |
88-
pytest -m "not repro and not load_model and litert" -n auto --max-worker-restart=0
88+
pytest -m "not repro and not load_model and litert" -n auto
8989
9090
- name: Test build
9191
run: |
@@ -136,17 +136,9 @@ jobs:
136136
python -m uv pip install twine build --upgrade
137137
python -m uv pip install --system .[tests,repro]
138138
139-
- name: Download models
140-
run: |
141-
pytest -m "load_model" -n auto --max-worker-restart=0
142-
143-
- name: Run standard tests incl. repro tests
144-
run: |
145-
pytest -m "not load_model and (not litert and not gpu)" -n auto --max-worker-restart=0
146-
147-
- name: Run LiteRT tests incl. repro tests
139+
- name: Run tests
148140
run: |
149-
pytest -m "not load_model and litert" -n auto --max-worker-restart=0
141+
python -m tox -e py312-repro
150142
151143
- name: Test build
152144
run: |

.github/workflows/codecov.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,9 @@ jobs:
3838
python -m pip install uv
3939
python -m uv pip install --system .[tests]
4040
41-
- name: Download models
41+
- name: Run coverage tests
4242
run: |
43-
pytest -m "not repro and load_model" -n auto --max-worker-restart=0 --cov=src/birdnet --cov-append --cov-report=
44-
45-
- name: Run standard tests
46-
run: |
47-
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto --max-worker-restart=0 --cov=src/birdnet --cov-append --cov-report=
48-
49-
- name: Run LiteRT tests
50-
run: |
51-
pytest -m "not repro and not load_model and litert" -n auto --max-worker-restart=0 --cov=src/birdnet --cov-append --cov-report=
52-
53-
- name: Show coverage report
54-
run: |
55-
coverage report
43+
python -m tox -e py312-coverage
5644
5745
- name: Upload results to Codecov
5846
uses: codecov/codecov-action@v5

pyproject.toml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ namespaces = true
171171
log_cli = true
172172
log_level = "DEBUG"
173173
timeout = 300
174+
addopts = ["--max-worker-restart=0"]
174175
testpaths = ["src/birdnet_tests"]
175176
norecursedirs = ["src/birdnet_v1_tests"]
176177
markers = [
@@ -209,39 +210,62 @@ select = [
209210
[tool.ruff.lint.isort]
210211
known-first-party = ["birdnet*"]
211212

213+
[tool.coverage.run]
214+
branch = true
215+
source = ["src/birdnet"]
216+
parallel = true
217+
218+
[tool.coverage.report]
219+
show_missing = true
220+
exclude_lines = ["if __name__ == .__main__.:"]
221+
212222
[tool.tox]
213223
legacy_tox_ini = """
214224
[tox]
215-
envlist = py{311,312,313}, py{312}-repro
225+
envlist = py{311,312,313}, py312-repro
216226
isolated_build = True
217227
218228
[testenv]
219-
setenv =
220-
COVERAGE_FILE = .coverage.{envname}
221229
package = wheel
222230
allowlist_externals = uv
223231
install_command = uv pip install {opts} {packages}
232+
skip_missing_interpreters = true
224233
225234
deps =
226235
.[tests,and-cuda]
227236
commands =
228237
# ruff check src/birdnet
229238
# ruff check src/birdnet_tests
230-
pytest -m "not repro and load_model" -n auto --max-worker-restart=0
231-
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto --max-worker-restart=0
232-
pytest -m "not repro and not load_model and litert" -n auto --max-worker-restart=0
233-
pytest -m "not repro and not load_model and gpu" -n 1 --max-worker-restart=0
239+
pytest -m "not repro and load_model" -n auto
240+
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto
241+
pytest -m "not repro and not load_model and litert" -n auto
242+
pytest -m "not repro and not load_model and gpu" -n 1
243+
python -m build -o dist/
244+
python -m twine check dist/*
234245
235246
[testenv:py312-repro]
236247
deps =
237248
.[tests,repro]
238249
commands =
239-
pytest -m "load_model" -n auto --max-worker-restart=0
250+
pytest -m "load_model" -n auto
240251
# run normal tests including repro tests
241-
pytest -m "not load_model and (not litert and not gpu)" -n auto --max-worker-restart=0
252+
pytest -m "not load_model and (not litert and not gpu)" -n auto
242253
# run litert tests including repro tests
243-
pytest -m "not load_model and litert" -n auto --max-worker-restart=0
254+
pytest -m "not load_model and litert" -n auto
244255
# gpu tests are not supported to be run with repro environment
256+
python -m build -o dist/
257+
python -m twine check dist/*
258+
259+
[testenv:py312-coverage]
260+
deps =
261+
.[tests]
262+
commands =
263+
coverage erase
264+
pytest -m "not repro and load_model" -n auto --cov=src/birdnet --cov-append --cov-report=
265+
pytest -m "not repro and not load_model and (not litert and not gpu)" -n auto --cov=src/birdnet --cov-append --cov-report=
266+
pytest -m "not repro and not load_model and litert" -n auto --cov=src/birdnet --cov-append --cov-report=
267+
pytest -m "not repro and not load_model and gpu" -n 1 --cov=src/birdnet --cov-append --cov-report=
268+
coverage report
245269
"""
246270

247271
[build-system]

0 commit comments

Comments
 (0)