Skip to content

Commit 94a0d2c

Browse files
authored
Merge pull request #5 from cloudblue/add_sonar_to_build
Add sonar to build workflow
2 parents 3c4b698 + 69c5e28 commit 94a0d2c

4 files changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build Connect Python OpenAPI Client
22

33
on:
44
push:
5-
branches: [ master, develop ]
5+
branches: '*'
66
tags:
77
- '*'
88
pull_request:
@@ -16,6 +16,8 @@ jobs:
1616
python-version: [3.6, 3.7, 3.8]
1717
steps:
1818
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
1921
- name: Set up Python ${{ matrix.python-version }}
2022
uses: actions/setup-python@v2
2123
with:
@@ -37,3 +39,12 @@ jobs:
3739
file: ./coverage.xml
3840
fail_ci_if_error: true
3941
verbose: true
42+
- name: Fix coverage.xml for Sonar
43+
run: |
44+
sed -i 's/\/home\/runner\/work\/connect-python-openapi-client\/connect-python-openapi-client\//\/github\/workspace\//g' coverage.xml
45+
- name: SonarCloud
46+
uses: SonarSource/sonarcloud-github-action@master
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
50+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Connect Python OpenAPI Client
22

3-
![pyversions](https://img.shields.io/pypi/pyversions/connect-openapi-client.svg) [![PyPi Status](https://img.shields.io/pypi/v/connect-openapi-client.svg)](https://pypi.org/project/connect-openapi-client/) [![Build Status](https://github.com/cloudblue/connect-python-openapi-client/workflows/Build%20Connect%20Python%20OpenAPI%20Client/badge.svg)](https://github.com/cloudblue/connect-python-openapi-client/actions) [![codecov](https://codecov.io/gh/cloudblue/connect-python-openapi-client/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudblue/connect-python-openapi-client)
3+
![pyversions](https://img.shields.io/pypi/pyversions/connect-openapi-client.svg) [![PyPi Status](https://img.shields.io/pypi/v/connect-openapi-client.svg)](https://pypi.org/project/connect-openapi-client/) [![Build Status](https://github.com/cloudblue/connect-python-openapi-client/workflows/Build%20Connect%20Python%20OpenAPI%20Client/badge.svg)](https://github.com/cloudblue/connect-python-openapi-client/actions) [![codecov](https://codecov.io/gh/cloudblue/connect-python-openapi-client/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudblue/connect-python-openapi-client) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=connect-open-api-client&metric=alert_status)](https://sonarcloud.io/dashboard?id=connect-open-api-client)
44

55

66

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.poetry]
2-
name = "connect-api-client"
2+
name = "connect-openapi-client"
33
version = "21.0.0"
44
description = "Connect Python OpenAPI Client"
55
authors = ["CloudBlue"]
@@ -38,9 +38,6 @@ build-backend = "poetry.core.masonry.api"
3838
[tool.pytest.ini_options]
3939
testpaths = "tests"
4040
addopts = "--cov=cnct --cov-report=term-missing:skip-covered --cov-report=html --cov-report=xml"
41-
python_files = "test_*.py"
42-
junit_family = "xunit2"
43-
log_cli = true
4441

4542
[tool.coverage.run]
4643
branch = true

sonar-project.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sonar.projectName=Connect Python OpenAPI Client
2+
sonar.projectKey=connect-open-api-client
3+
sonar.organization=cloudbluesonarcube
4+
5+
sonar.language=py
6+
7+
sonar.sources=cnct
8+
sonar.tests=tests
9+
sonar.inclusions=cnct/**
10+
sonar.exclusions=tests/**
11+
12+
sonar.python.coverage.reportPaths=./coverage.xml

0 commit comments

Comments
 (0)