Skip to content

Commit d8d0178

Browse files
committed
Using coverage of py3.12 only
Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
1 parent e50bcb1 commit d8d0178

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,21 @@ jobs:
2828
pip install pytest pytest-cov respx
2929
pip install -e .
3030
31-
- name: Test with pytest
31+
- name: Test with coverage (only on 3.12)
32+
if: matrix.python-version == '3.12'
3233
run: |
33-
pytest -xvs tests/ --cov=arcsecond --cov-report=xml
34-
mv .coverage .coverage.${{ matrix.python-version }}
34+
pytest -xvs tests/ --cov=arcsecond --cov-report=xml:coverage.xml
3535
36-
- name: Upload coverage artifact
36+
- name: Test without coverage
37+
if: matrix.python-version != '3.12'
38+
run: pytest -xvs tests/
39+
40+
- name: Upload coverage artifact (only on 3.12)
41+
if: matrix.python-version == '3.12'
3742
uses: actions/upload-artifact@v4
3843
with:
39-
name: coverage-${{ matrix.python-version }}
40-
path: .coverage.${{ matrix.python-version }}
44+
name: coverage
45+
path: coverage.xml
4146

4247
scan:
4348
runs-on: ubuntu-latest
@@ -46,23 +51,11 @@ jobs:
4651
steps:
4752
- uses: actions/checkout@v4
4853

49-
- name: Set up Python
50-
uses: actions/setup-python@v4
51-
with:
52-
python-version: "3.12"
53-
54-
- name: Download all coverage artifacts
54+
- name: Download coverage artifact
5555
uses: actions/download-artifact@v4
5656
with:
57-
path: coverages
58-
59-
- name: Install coverage.py
60-
run: pip install coverage
61-
62-
- name: Merge coverage files
63-
run: |
64-
coverage combine coverages
65-
coverage xml -o coverage.xml
57+
name: coverage
58+
path: .
6659

6760
- name: SonarQube Scan
6861
uses: SonarSource/sonarcloud-github-action@master

0 commit comments

Comments
 (0)