-
Notifications
You must be signed in to change notification settings - Fork 15
35 lines (26 loc) · 1.02 KB
/
sonar.yaml
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
name: Sonar Scan
on: [push, pull_request_target]
jobs:
sonar:
name: Sonar Scan
runs-on: ubuntu-latest
# always run on push events
# only run on pull_request_target event when pull request pulls from fork repository
if: >
github.event_name == 'push' ||
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/[email protected]
with:
python-version: 3.9
- run: pip install -r requirements.txt
- run: pip install -e .[dev]
- run: pytest --cov=yoti_python_sdk yoti_python_sdk/tests --cov-report=xml:coverage-reports/coverage-new.xml
- run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage-reports/coverage-new.xml
- uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}