Debian Codegraph @

.github/workflows/tests.yml

raw symbols SCIP
1 name: Run Tests
2
3 on:
4 # Run tests on push to main, master, or any release/ branch
5 push:
6 branches: [main, master, 'release/**']
7 # Always test on pull requests targeting main/master
8 pull_request:
9 branches: [main, master]
10 # Allow manual triggering via GitHub UI
11 workflow_dispatch:
12
13 jobs:
14 test:
15 name: Python ${{ matrix.python-version }} – ${{ matrix.tox_env }} on ${{ matrix.os }}
16 runs-on: ${{ matrix.os || 'ubuntu-latest' }}
17
18 strategy:
19 fail-fast: false # Let all jobs run, even if one fails
20 matrix:
21 include:
22 - python-version: "3.9"
23 tox_env: qa
24 - python-version: "3.10"
25 tox_env: qa
26 - python-version: "3.11"
27 tox_env: qa
28 - python-version: "3.12"
29 tox_env: qa
30
31 # Pre-release testing (won't fail entire workflow if this fails)
32 - python-version: "3.13-dev"
33 tox_env: qa
34 continue-on-error: true
35
36 - python-version: "3.14-dev"
37 tox_env: qa
38 continue-on-error: true
39
40 - python-version: "3.15-dev"
41 tox_env: qa
42 continue-on-error: true
43
44 # Platform validation only (one version)
45 - os: windows-latest
46 python-version: "3.12"
47 tox_env: qa
48
49 - os: macos-latest
50 python-version: "3.12"
51 tox_env: qa
52
53 # Minimal test run on latest Python only
54 # this verifies Apprise still works when extra libraries are not available
55 - python-version: "3.12"
56 tox_env: minimal
57
58 steps:
59 - uses: actions/checkout@v7
60
61 # Install tox for isolated environment and plugin test orchestration
62 - name: Install tox
63 run: python -m pip install tox
64
65 # Run tox with the specified environment (qa, minimal, etc.)
66 - name: Run tox for ${{ matrix.tox_env }}
67 run: tox -e ${{ matrix.tox_env }}
68
69 - name: Upload coverage report
70 if: always()
71 uses: actions/upload-artifact@v7
72 with:
73 name: coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.tox_env }}
74 path: .coverage
75 include-hidden-files: true
76
77 codecov:
78 name: Upload merged coverage to Codecov
79 runs-on: ubuntu-latest
80 needs: test # Waits for all matrix jobs to complete
81 if: always() # Even if a test fails, still attempt to upload what we have
82
83 steps:
84 - uses: actions/checkout@v7
85
86 - name: Download all coverage reports
87 uses: actions/download-artifact@v8
88 with:
89 path: coverage-artifacts
90
91 - name: Combine and generate coverage
92 run: |
93 pip install coverage
94
95 # Create a consistent temp dir
96 mkdir -p coverage-inputs
97
98 # Copy and rename each coverage file to .coverage.job_name
99 i=0
100 for f in $(find coverage-artifacts -name .coverage); do
101 cp "$f" "coverage-inputs/.coverage.$i"
102 i=$((i+1))
103 done
104
105 # Confirm files staged
106 ls -alh coverage-inputs
107
108 # Combine them all
109 coverage combine coverage-inputs
110 coverage report
111 coverage xml -o coverage.xml
112
113 # Upload merged coverage results to Codecov for visualization
114 - name: Upload to Codecov
115 uses: codecov/codecov-action@v7
116 with:
117 token: ${{ secrets.CODECOV_TOKEN }}
118 files: coverage.xml
119 verbose: false # Used for debugging only
120 fail_ci_if_error: false # Avoid failing job if Codecov is down
121 env:
122 CODECOV_PR: ${{ github.event.pull_request.number }}
123 CODECOV_SHA: ${{ github.sha }}