File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Sonar
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ jobs :
10+ build :
11+ env :
12+ SONAR_SCANNER_VERSION : 3.3.0.1492
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - uses : actions/checkout@v2
17+ - name : Set up Python 3.8
18+ uses : actions/setup-python@v2
19+ with :
20+ python-version : 3.8
21+ - name : Install dependencies
22+ run : |
23+ pip3 install -r requirements.txt
24+ pip3 install .
25+ pip3 install coverage
26+ wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip
27+ unzip sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip
28+ - name : Run Tests
29+ run : |
30+ coverage run --source=client_encryption/ -m pytest --junitxml=tests.xml
31+ coverage xml -o coverage.xml
32+ - name : Sonar
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
36+ run : |
37+ sonar-scanner-$SONAR_SCANNER_VERSION/bin/sonar-scanner \
38+ -Dsonar.projectName=client-encryption-python \
39+ -Dsonar.projectKey=Mastercard_client-encryption-python \
40+ -Dsonar.organization=mastercard \
41+ -Dsonar.sources=./client_encryption \
42+ -Dsonar.tests=./tests \
43+ -Dsonar.python.coverage.reportPaths=coverage.xml \
44+ -Dsonar.host.url=https://sonarcloud.io \
45+ -Dsonar.login=$SONAR_TOKEN
You can’t perform that action at this time.
0 commit comments