diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddc9c6c..ea2ea1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV - name: Linting run: | - poetry run flake8 + poetry run ruff check . - name: Testing run: | poetry run pytest @@ -65,9 +65,15 @@ jobs: - name: Testing run: | poetry run pytest - - name: Publish coverage - uses: codecov/codecov-action@v1 + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@v4 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: SonarQube Quality Gate check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master with: - file: ./coverage.xml - fail_ci_if_error: true - verbose: true + pollingTimeoutSec: 600 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cee4c2b..f12c09b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/README.md b/README.md index 27d2ca2..a34b156 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # interrogatio -![Python versions](https://img.shields.io/pypi/pyversions/interrogatio.svg) [![PyPi Status](https://img.shields.io/pypi/v/interrogatio.svg)](https://pypi.org/project/interrogatio/) ![Read the Docs](https://img.shields.io/readthedocs/interrogatio) [![Build Status](https://img.shields.io/github/workflow/status/ffaraone/interrogatio/Build%20interrogatio)](https://github.com/ffaraone/interrogatio/actions) [![codecov](https://codecov.io/gh/ffaraone/interrogatio/branch/master/graph/badge.svg)](https://codecov.io/gh/ffaraone/interrogatio) - +![Python versions](https://img.shields.io/pypi/pyversions/interrogatio.svg) [![PyPi Status](https://img.shields.io/pypi/v/interrogatio.svg)](https://pypi.org/project/interrogatio/) ![Read the Docs](https://img.shields.io/readthedocs/interrogatio) [![Build Status](https://img.shields.io/github/workflow/status/ffaraone/interrogatio/Build%20interrogatio)](https://github.com/ffaraone/interrogatio/actions) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ffaraone_interrogatio&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ffaraone_interrogatio) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ffaraone_interrogatio&metric=coverage)](https://sonarcloud.io/summary/new_code?id=ffaraone_interrogatio) A python library to prompt users for inputs in a terminal application. diff --git a/pyproject.toml b/pyproject.toml index 122c9b0..50ba812 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ addopts = "--cov=interrogatio --cov-report=term-missing:skip-covered --cov-repor [tool.coverage.run] branch = true +relative_files = true [tool.coverage.report] omit = [ diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..9ea7cbe --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=ffaraone_interrogatio +sonar.organization=ffaraone + +sonar.language=py + +sonar.sources=interrogatio +sonar.tests=tests +sonar.inclusions=interrogatio/** +sonar.exclusions=tests/**,Dockerfile + +sonar.python.coverage.reportPaths=coverage.xml +sonar.python.xunit.reportPath=coverage.xml +sonar.python.version=3 \ No newline at end of file