Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/archomeda/sonarcloud-dotnet-action
https://github.com/archomeda/sonarcloud-dotnet-action
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/archomeda/sonarcloud-dotnet-action
- Owner: Archomeda
- License: mit
- Created: 2020-06-27T15:30:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-18T22:08:46.000Z (over 2 years ago)
- Last Synced: 2023-03-22T19:01:25.908Z (almost 2 years ago)
- Language: JavaScript
- Size: 108 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Action: SonarCloud for .NET
This action allows scanning your .NET project(s) with SonarCloud.
## Usage
You can use this action on pushed commits, pull requests and pushed tags.
Whenever a commit on the default branch is pushed, this action will use the name of that branch as a version tag on SonarCloud to prevent a previous version tag from moving to the most recent analysis.```yaml
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # This is necessary to get blame information in SonarCloud
- uses: actions/setup-java@v1
with:
java-version: '>=11' # SonarCloud has deprecated usage of Java 8,
# and GitHub actions includes Java 8 by default
- uses: Archomeda/sonarcloud-dotnet-action@v1
with:
sonarToken: ${{ secrets.SONAR_TOKEN }} # (Required) Your SonarCloud token
sonarOrganization: 'organizationKey' # (Required) SonarCloud organization key
sonarProject: 'projectKey' # (Required) SonarCloud project key
sonarUrl: 'https://sonarcloud.io' # (Optional) SonarCloud host URL
sonarProjectBaseDir: 'some-dir' # (Optional) SonarCloud project base directory
- run: dotnet build
```If you want to include code coverage, the following example works with coverlet:
```yaml
- uses: Archomeda/sonarcloud-dotnet-action@v1
with:
sonarToken: ${{ secrets.SONAR_TOKEN }}
sonarOrganization: 'organizationKey'
sonarProject: 'projectKey'
sonarAdditionalArgs: /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml
- run: dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
```