|
10 | 10 | env: |
11 | 11 | CACHE_VERSION: 1 |
12 | 12 | KEY_PREFIX: venv |
13 | | - DEFAULT_PYTHON: "3.10" |
| 13 | + DEFAULT_PYTHON: "3.11" |
14 | 14 | PRE_COMMIT_CACHE: ~/.cache/pre-commit |
15 | 15 |
|
16 | 16 | jobs: |
@@ -122,59 +122,13 @@ jobs: |
122 | 122 | - name: Run pytest |
123 | 123 | run: | |
124 | 124 | . venv/bin/activate |
125 | | - pytest --cov --cov-report= tests/ |
| 125 | + pytest --cov |
126 | 126 | - name: Upload coverage artifact |
127 | 127 | |
128 | 128 | with: |
129 | | - name: coverage-${{ matrix.python-version }} |
| 129 | + name: coverage-linux-${{ matrix.python-version }} |
130 | 130 | path: .coverage |
131 | 131 |
|
132 | | - coverage: |
133 | | - name: tests / process / coverage |
134 | | - runs-on: ubuntu-latest |
135 | | - timeout-minutes: 5 |
136 | | - needs: ["tests-linux"] |
137 | | - strategy: |
138 | | - matrix: |
139 | | - python-version: ["3.10"] |
140 | | - env: |
141 | | - COVERAGERC_FILE: .coveragerc |
142 | | - steps: |
143 | | - - name: Check out code from GitHub |
144 | | - |
145 | | - - name: Set up Python ${{ matrix.python-version }} |
146 | | - id: python |
147 | | - |
148 | | - with: |
149 | | - python-version: ${{ matrix.python-version }} |
150 | | - check-latest: true |
151 | | - - name: Restore Python virtual environment |
152 | | - id: cache-venv |
153 | | - |
154 | | - with: |
155 | | - path: venv |
156 | | - key: |
157 | | - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ |
158 | | - needs.tests-linux.outputs.python-key }} |
159 | | - - name: Fail job if Python cache restore failed |
160 | | - if: steps.cache-venv.outputs.cache-hit != 'true' |
161 | | - run: | |
162 | | - echo "Failed to restore Python venv from cache" |
163 | | - exit 1 |
164 | | - - name: Download all coverage artifacts |
165 | | - |
166 | | - - name: Combine coverage results |
167 | | - run: | |
168 | | - . venv/bin/activate |
169 | | - coverage combine coverage*/.coverage |
170 | | - coverage report --rcfile=${{ env.COVERAGERC_FILE }} |
171 | | - - name: Upload coverage to Coveralls |
172 | | - env: |
173 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
174 | | - run: | |
175 | | - . venv/bin/activate |
176 | | - coveralls --rcfile=${{ env.COVERAGERC_FILE }} --service=github |
177 | | -
|
178 | 132 | tests-windows: |
179 | 133 | name: tests / run / ${{ matrix.python-version }} / Windows |
180 | 134 | runs-on: windows-latest |
@@ -222,7 +176,12 @@ jobs: |
222 | 176 | - name: Run pytest |
223 | 177 | run: | |
224 | 178 | . venv\\Scripts\\activate |
225 | | - pytest tests/ |
| 179 | + pytest --cov |
| 180 | + - name: Upload coverage artifact |
| 181 | + |
| 182 | + with: |
| 183 | + name: coverage-windows-${{ matrix.python-version }} |
| 184 | + path: .coverage |
226 | 185 |
|
227 | 186 | tests-pypy: |
228 | 187 | name: tests / run / ${{ matrix.python-version }} / Linux |
@@ -266,4 +225,58 @@ jobs: |
266 | 225 | - name: Run pytest |
267 | 226 | run: | |
268 | 227 | . venv/bin/activate |
269 | | - pytest tests/ |
| 228 | + pytest --cov |
| 229 | + - name: Upload coverage artifact |
| 230 | + |
| 231 | + with: |
| 232 | + name: coverage-pypy-${{ matrix.python-version }} |
| 233 | + path: .coverage |
| 234 | + |
| 235 | + coverage: |
| 236 | + name: tests / process / coverage |
| 237 | + runs-on: ubuntu-latest |
| 238 | + timeout-minutes: 10 |
| 239 | + needs: ["tests-linux", "tests-windows", "tests-pypy"] |
| 240 | + steps: |
| 241 | + - name: Check out code from GitHub |
| 242 | + |
| 243 | + - name: Set up Python 3.11 |
| 244 | + id: python |
| 245 | + |
| 246 | + with: |
| 247 | + python-version: "3.11" |
| 248 | + check-latest: true |
| 249 | + - name: Install dependencies |
| 250 | + run: pip install -U -r requirements_test_min.txt |
| 251 | + - name: Download all coverage artifacts |
| 252 | + |
| 253 | + - name: Combine Linux coverage results |
| 254 | + run: | |
| 255 | + coverage combine coverage-linux*/.coverage |
| 256 | + coverage xml -o coverage-linux.xml |
| 257 | + - uses: codecov/codecov-action@v3 |
| 258 | + with: |
| 259 | + fail_ci_if_error: true |
| 260 | + verbose: true |
| 261 | + flags: linux |
| 262 | + files: coverage-linux.xml |
| 263 | + - name: Combine Windows coverage results |
| 264 | + run: | |
| 265 | + coverage combine coverage-windows*/.coverage |
| 266 | + coverage xml -o coverage-windows.xml |
| 267 | + - uses: codecov/codecov-action@v3 |
| 268 | + with: |
| 269 | + fail_ci_if_error: true |
| 270 | + verbose: true |
| 271 | + flags: windows |
| 272 | + files: coverage-windows.xml |
| 273 | + - name: Combine PyPy coverage results |
| 274 | + run: | |
| 275 | + coverage combine coverage-pypy*/.coverage |
| 276 | + coverage xml -o coverage-pypy.xml |
| 277 | + - uses: codecov/codecov-action@v3 |
| 278 | + with: |
| 279 | + fail_ci_if_error: true |
| 280 | + verbose: true |
| 281 | + flags: pypy |
| 282 | + files: coverage-pypy.xml |
0 commit comments