diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65c3dc2..1810eb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,13 +36,11 @@ jobs: - name: Test & Coverage Collection if: ${{ matrix.os == 'ubuntu-22.04' && matrix.dotnet == '7.0.x' }} - run: dotnet test APIMatic.Core.Test/APIMatic.Core.Test.csproj -p:CollectCoverage=true -p:CoverletOutputFormat=lcov - - # - name: Upload coverage report - # if: ${{ matrix.os == 'ubuntu-22.04' && matrix.dotnet == '7.0.x' && github.actor != 'dependabot[bot]' }} - # uses: paambaati/codeclimate-action@v3.0.0 - # env: - # CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_KEY }} - # with: - # coverageLocations: | - # ${{github.workspace}}/APIMatic.Core.Test/coverage.info:lcov + run: dotnet test APIMatic.Core.Test/APIMatic.Core.Test.csproj -p:CollectCoverage=true -p:CoverletOutputFormat=opencover + + - name: SonarQube Scan + if: ${{ github.actor != 'dependabot[bot]' && matrix.os == 'ubuntu-22.04' && matrix.dotnet == '7.0.x' }} + uses: SonarSource/sonarqube-scan-action@v5.2.0 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 8a2fe62..01be839 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Version][nuget-version]][nuget-url] [![Build & Tests][test-badge]][test-url] [![Test Coverage][coverage-badge]][coverage-url] +[![Vulnerabilities][vulnerabilities-badge]][vulnerabilities-url] [![Maintainability][maintainability-badge]][maintainability-url] [![Licence][license-badge]][license-url] @@ -44,13 +45,17 @@ This project contains core logic and the utilities for the APIMatic's C# SDK [test-url]: https://github.com/apimatic/core-lib-csharp/actions/workflows/test.yml -[coverage-badge]: https://api.codeclimate.com/v1/badges/d613a5f73f605369e745/test_coverage +[coverage-badge]: https://sonarcloud.io/api/project_badges/measure?project=apimatic_core-lib-csharp&metric=coverage -[coverage-url]: https://codeclimate.com/github/apimatic/core-lib-csharp/test_coverage +[coverage-url]: https://sonarcloud.io/summary/new_code?id=apimatic_core-lib-csharp -[maintainability-badge]: https://api.codeclimate.com/v1/badges/d613a5f73f605369e745/maintainability +[vulnerabilities-badge]: https://sonarcloud.io/api/project_badges/measure?project=apimatic_core-lib-csharp&metric=vulnerabilities -[maintainability-url]: https://codeclimate.com/github/apimatic/core-lib-csharp/maintainability +[vulnerabilities-url]: https://sonarcloud.io/summary/new_code?id=apimatic_core-lib-csharp + +[maintainability-badge]: https://sonarcloud.io/api/project_badges/measure?project=apimatic_core-lib-csharp&metric=sqale_rating + +[maintainability-url]: https://sonarcloud.io/summary/new_code?id=apimatic_core-lib-csharp [license-badge]: https://img.shields.io/badge/licence-MIT-blue diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..14d8e2f --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.projectKey=apimatic_core-lib-csharp +sonar.organization=apimatic +sonar.projectName=APIMatic Core Library C\# +sonar.host.url=https://sonarcloud.io +sonar.sourceEncoding=UTF-8 + +sonar.sources=APIMatic.Core + +sonar.tests=APIMatic.Core.Test + +sonar.cs.opencover.reportsPaths=APIMatic.Core.Test/coverage.opencover.xml \ No newline at end of file