@@ -47,23 +47,62 @@ jobs:
4747 run : |
4848 python3 -m coverage report
4949
50- - name : Coverage lcov
50+ - name : Coverage lcov (codecov)
5151 run : |
5252 python3 -m coverage lcov -o coverage/lcov.info
5353
54- - name : Upload coverage reports to Codecov with GitHub Action
55- uses : codecov/codecov-action@v5
54+ - name : Coverage xml (sonarcloud)
55+ run : |
56+ python3 -m coverage xml -o coverage/coverage.xml
57+
58+ - name : Upload coverage artifact
59+ uses : actions/upload-artifact@v4
5660 with :
57- token : ${{ secrets.CODECOV_TOKEN }} # required
58- verbose : true # optional (default = false)
61+ name : coverage-report
62+ path : coverage
5963
60- - name : Coverage XML
61- run : |
62- python3 -m coverage xml
64+ codecov :
65+ name : Upload to Codecov
66+ runs-on : ubuntu-24.04
67+ needs : coverage
68+
69+ steps :
70+ - name : Checkout repository
71+ uses : actions/checkout@v5
72+ with :
73+ fetch-depth : 0
74+ - name : Download coverage artifact
75+ uses : actions/download-artifact@v5
76+ with :
77+ name : coverage-report
78+ path : coverage
79+
80+ - name : Upload coverage reports to Codecov
81+ uses : codecov/codecov-action@3cb13a12348ef4ffcf9783ac0f74954f92113e33
82+ with :
83+ token : ${{ secrets.CODECOV_TOKEN }}
84+ verbose : true
85+
86+ sonarqube :
87+ name : Analyze with SonarQube
88+ runs-on : ubuntu-24.04
89+ needs : coverage
90+
91+ steps :
92+ - name : Checkout repository
93+ uses : actions/checkout@v5
94+ with :
95+ fetch-depth : 0
96+
97+ - name : Download coverage artifact
98+ uses : actions/download-artifact@v5
99+ with :
100+ name : coverage-report
101+ path : coverage
63102
64- - name : Analyze with SonarQube / SonarCloud
65- uses : SonarSource/sonarqube-scan-action@master
103+ - name : SonarQube Scan
104+ # yamllint disable-line rule:line-length
105+ uses : SonarSource/sonarqube-scan-action@8c71dc039c2dd71d3821e89a2b58ecc7fee6ced9
66106 env :
67107 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
68- # Needed to get PR information, if any
69108 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments