Skip to content

Commit c7bcdca

Browse files
committed
continued improvements to github action and workflow/builds
1 parent 272939a commit c7bcdca

4 files changed

Lines changed: 89 additions & 33 deletions

File tree

.coveragerc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,60 @@ on:
99

1010
jobs:
1111
test:
12-
name: Test (${{ matrix.tox_env }})
13-
runs-on: ubuntu-latest
12+
name: Python ${{ matrix.python-version }} – ${{ matrix.tox_env }}
1413

1514
strategy:
1615
fail-fast: false
1716
matrix:
18-
tox_env: [minimal, qa]
17+
include:
18+
- python-version: "3.7"
19+
# pin older os as latest does not support v3.7
20+
runs-on: ubuntu-22.04
21+
tox_env: qa
22+
- python-version: "3.8"
23+
# pin older os as latest does not support v3.8
24+
runs-on: ubuntu-22.04
25+
tox_env: qa
26+
- python-version: "3.9"
27+
runs-on: ubuntu-latest
28+
tox_env: qa
29+
- python-version: "3.10"
30+
runs-on: ubuntu-latest
31+
tox_env: qa
32+
- python-version: "3.11"
33+
runs-on: ubuntu-latest
34+
tox_env: qa
35+
- python-version: "3.12"
36+
runs-on: ubuntu-latest
37+
tox_env: qa
38+
- python-version: "3.12"
39+
runs-on: ubuntu-latest
40+
tox_env: minimal
1941

2042
steps:
2143
- uses: actions/checkout@v4
2244

23-
- name: Set up Python
45+
- name: Set up Python ${{ matrix.python-version }}
2446
uses: actions/setup-python@v5
2547
with:
26-
python-version: "3.12"
48+
python-version: ${{ matrix.python-version }}
2749

2850
- name: Install tox
2951
run: python -m pip install tox
3052

3153
- name: Run tox for ${{ matrix.tox_env }}
3254
run: tox -e ${{ matrix.tox_env }}
3355

56+
- name: Debug coverage location
57+
run: |
58+
find . -name ".coverage*" -exec ls -l {} \;
59+
3460
- name: Upload coverage report
3561
if: always()
3662
uses: actions/upload-artifact@v4
3763
with:
3864
name: coverage-${{ matrix.tox_env }}
39-
path: coverage.xml
65+
path: .coverage-reports/.coverage.*
4066

4167
codecov:
4268
name: Upload merged coverage to Codecov
@@ -52,15 +78,24 @@ jobs:
5278
with:
5379
path: coverage-artifacts
5480

55-
- name: Combine coverage files
81+
- name: Combine and generate coverage
5682
run: |
5783
pip install coverage
58-
coverage combine coverage-artifacts/**/coverage.xml
84+
mkdir -p .coverage-reports
85+
find coverage-artifacts -name '.coverage.*' -exec cp {} .coverage-reports/ \;
86+
coverage combine .coverage-reports
87+
coverage report
5988
coverage xml
6089
90+
- name: Upload final Coverage XML
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: combined-coverage
94+
path: coverage.xml
95+
6196
- name: Upload to Codecov
6297
uses: codecov/codecov-action@v4
6398
with:
6499
token: ${{ secrets.CODECOV_TOKEN }}
65-
file: coverage.xml
66100
fail_ci_if_error: false
101+

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,23 @@ addopts = "-ra"
293293
python_files = ["tests/test_*.py"]
294294
norecursedirs = ["tests/helpers", "dist"]
295295
filterwarnings = ["once::Warning"]
296+
297+
[tool.coverage.run]
298+
branch = true
299+
parallel = true
300+
data_file = ".coverage-reports/.coverage"
301+
source = ["apprise"]
302+
relative_files = true
303+
304+
[tool.coverage.paths]
305+
source = [
306+
"apprise",
307+
"/apprise/apprise",
308+
".tox/*/lib/python*/site-packages/apprise",
309+
".tox/pypy/site-packages/apprise"
310+
]
311+
312+
[tool.coverage.report]
313+
show_missing = true
314+
skip_covered = true
315+
skip_empty = true

tox.ini

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[global]
2+
alwayscopy = True
3+
4+
[gh]
5+
use_discover = False
6+
17
[tox]
28
envlist =
39
clean
@@ -8,11 +14,17 @@ envlist =
814
release
915
validate
1016
twine-check
17+
minversion = 4.0
18+
requires = virtualenv>=20.0.0
19+
isolated_build = True
1120

1221
[testenv]
1322
skip_install = false
1423
usedevelop = true
1524
allowlist_externals = *
25+
ensurepip = true
26+
setenv =
27+
COVERAGE_RCFILE = {toxinidir}/pyproject.toml
1628

1729
[testenv:build-rpm]
1830
description = Run RPM packaging via Docker
@@ -52,20 +64,24 @@ commands =
5264
[testenv:qa]
5365
description = Full tests with all plugins + code coverage
5466
extras = dev,all-plugins
55-
deps = coverage
5667
commands =
57-
coverage run -m pytest tests {posargs}
58-
coverage report
59-
coverage xml
68+
pip install --no-cache-dir -e .
69+
coverage run --source=apprise -m pytest tests {posargs}
6070

6171
[testenv:minimal]
6272
description = Minimal dependencies + code coverage
6373
extras = dev
74+
commands =
75+
pip install --no-cache-dir -e .
76+
coverage run --source=apprise -m pytest tests {posargs}
77+
78+
[testenv:coverage-report]
79+
skip_install = true
6480
deps = coverage
6581
commands =
66-
coverage run -m pytest tests {posargs}
67-
coverage report
68-
coverage xml
82+
coverage combine
83+
coverage report
84+
coverage xml
6985

7086
[testenv:clean]
7187
description = Remove build artifacts and cache files
@@ -81,7 +97,9 @@ commands =
8197

8298
[testenv:i18n]
8399
description = Extract and update .pot/.po files for translation
100+
extras = dev
84101
deps = Babel
102+
ensurepip = true
85103
commands =
86104
mkdir -p apprise/i18n
87105
pybabel extract -F babel.cfg -o apprise/i18n/apprise.pot apprise

0 commit comments

Comments
 (0)