File tree Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 7
7
branches : [ '*' ]
8
8
9
9
jobs :
10
- test :
10
+ tests :
11
11
runs-on : ubuntu-latest
12
12
strategy :
13
13
matrix :
@@ -30,21 +30,41 @@ jobs:
30
30
31
31
- name : Test with pytest
32
32
run : |
33
- pytest -xvs tests/ --cov=arcsecond --cov-report=xml
33
+ pytest -xvs tests/ --cov=arcsecond --cov-report=xml:coverage-${{ matrix.python-version }}.xml
34
34
35
- - name : Upload coverage to Codecov
36
- uses : codecov/codecov-action@v3
35
+ - name : Upload coverage artifact
36
+ uses : actions/upload-artifact@v4
37
37
with :
38
- file : ./ coverage.xml
39
- fail_ci_if_error : false
38
+ name : coverage-${{ matrix.python-version }}
39
+ path : coverage-${{ matrix.python-version }}.xml
40
40
41
41
scan :
42
42
runs-on : ubuntu-latest
43
+ needs : tests
44
+
43
45
steps :
44
46
- uses : actions/checkout@v4
45
-
47
+
48
+ - name : Set up Python
49
+ uses : actions/setup-python@v4
50
+ with :
51
+ python-version : " 3.12"
52
+
53
+ - name : Download all coverage artifacts
54
+ uses : actions/download-artifact@v4
55
+ with :
56
+ path : coverages
57
+
58
+ - name : Install coverage.py
59
+ run : pip install coverage
60
+
61
+ - name : Merge coverage files
62
+ run : |
63
+ coverage combine coverages
64
+ coverage xml -o coverage.xml
65
+
46
66
- name : SonarQube Scan
47
- uses : SonarSource/sonarqube-scan -action@v4
67
+ uses : SonarSource/sonarcloud-github -action@master
48
68
env :
49
69
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
50
70
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ sonar.tests=./tests
15
15
sonar.test.exclusions =
16
16
sonar.test.inclusions =**/tests/**,**/_tests_/**
17
17
18
+ sonar.python.coverage.reportPaths =coverage.xml
19
+
18
20
# Encoding of the source code. Default is default system encoding
19
21
sonar.sourceEncoding =UTF-8
20
22
You can’t perform that action at this time.
0 commit comments