diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a1b2a0..1c267d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,7 +55,15 @@ jobs: ckan -c test.ini db init - name: Run tests - run: pytest --ckan-ini=test.ini --cov=ckanext.fairdatapoint --disable-warnings ckanext/fairdatapoint + run: pytest --ckan-ini=test.ini --cov=ckanext.fairdatapoint --disable-warnings ckanext/fairdatapoint + - name: Generate coverage report + run: coverage xml -o coverage.xml + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - uses: actions/checkout@v4 - name: REUSE Compliance Check uses: fsfe/reuse-action@v2 diff --git a/README.md b/README.md index 7739fc5..0383db0 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ SPDX-License-Identifier: CC-BY-4.0 [![REUSE status](https://api.reuse.software/badge/github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint)](https://api.reuse.software/info/github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint) [![Tests](https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint/actions/workflows/test.yml/badge.svg)](https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint/actions/workflows/test.yml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GenomicDataInfrastructure_gdi-userportal-ckanext-fairdatapoint&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=GenomicDataInfrastructure_gdi-userportal-ckanext-fairdatapoint) [![Release](https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint/actions/workflows/release.yml/badge.svg)](https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint/actions/workflows/release.yml) [![Main](https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint/actions/workflows/main.yml/badge.svg)](https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint/actions/workflows/main.yml) [![GitHub contributors](https://img.shields.io/github/contributors/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint)](https://github.com/GenomicDataInfrastructure/gdi-userportal-ckanext-fairdatapoint/graphs/contributors) diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..788491c --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2024 LNDS +# +# SPDX-License-Identifier: CC-BY-4.0 + +sonar.projectKey=GenomicDataInfrastructure_gdi-userportal-ckanext-fairdatapoint +sonar.organization=genomicdatainfrastructure +sonar.sources=ckanext/fairdatapoint +sonar.exclusions=**/tests/** +sonar.tests=ckanext/fairdatapoint/tests +sonar.test.inclusions=ckanext/fairdatapoint/tests/**/*.py +sonar.python.coverage.reportPaths=coverage.xml +sonar.python.version=3.10 diff --git a/test.ini b/test.ini index 6968e3a..fe4402d 100644 --- a/test.ini +++ b/test.ini @@ -1,6 +1,6 @@ ; SPDX-FileCopyrightText: 2024 Stichting Health-RI ; -; SPDX-License-Identifier: Apache-2.0 +; SPDX-License-Identifier: CC-BY-4.0 [DEFAULT]