Skip to content

Commit 514992a

Browse files
committed
Added sonar workflow, configured tox.ini, sonar-project.properties setup
1 parent 4d759f0 commit 514992a

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.github/workflows/sonar.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: SonarCloud analysis
2+
3+
on: [push]
4+
5+
jobs:
6+
sonarcloud:
7+
name: SonarCloud
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [ "pypy3.8" ]
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install tox
19+
run: pip install tox
20+
- name: Run tox
21+
run: tox -e py
22+
- name: SonarCloud Scan
23+
uses: SonarSource/sonarcloud-github-action@master
24+
env:
25+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sonar.projectKey=infobip_infobip-api-python-client
2+
sonar.organization=infobip
3+
4+
sonar.python.coverage.reportPaths=coverage.xml

tox.ini

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[tox]
2+
envlist = py38
3+
skipsdist = True
4+
5+
[testenv]
6+
deps =
7+
pytest
8+
coverage
9+
commands =
10+
pip install -r requirements.txt
11+
pip install -r test-requirements.txt
12+
coverage run -m pytest
13+
coverage xml
14+
15+
[coverage:run]
16+
relative_files = True
17+
source = infobip_api_client/
18+
branch = True

0 commit comments

Comments
 (0)