-
Notifications
You must be signed in to change notification settings - Fork 516
36 lines (35 loc) · 1.33 KB
/
sonar-merge-main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Sonar Scan and Coverage
on:
push:
branches:
- main
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
if: github.repository == 'hyperledger/aries-cloudagent-python'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Tests
uses: ./.github/actions/run-unit-tests
with:
python-version: "3.12"
os: "ubuntu-latest"
is_pr: "false"
- name: Adjust Test Coverage Source
run: |
# Need to change source in coverage report because it was generated from another context
sed -i 's/\/home\/runner\/work\/aries-cloudagent-python\/aries-cloudagent-python\//\/github\/workspace\//g' test-reports/coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.python.coverage.reportPaths=test-reports/coverage.xml
-Dsonar.coverage.exclusions=**/tests/**,**/demo/**,**/docs/**,**/docker/**,**/scripts/**,**/scenarios/**
-Dsonar.cpd.exclusions=**/tests/**,**/demo/**,**/docs/**,**/docker/**,**/scripts/**,**/scenarios/**
-Dsonar.sources=./