-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.42 KB
/
sonarcloud.yml
File metadata and controls
51 lines (45 loc) · 1.42 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: SonarCloud Analysis
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
- name: Run tests with coverage
run: |
pytest tests/ --cov=githubauthlib --cov-report=xml --cov-report=term-missing
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=flexrpl
-Dsonar.projectKey=fleXRPL_githubauthlib
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.sources=githubauthlib
-Dsonar.tests=tests
-Dsonar.python.version=3
-Dsonar.sourceEncoding=UTF-8
-Dsonar.exclusions=docs/**,scripts/**
-Dsonar.coverage.exclusions=tests/**,docs/**,scripts/**
-Dsonar.python.xunit.reportPath=test-results.xml