We are trying to integrate Sonar scan for code coverage for dontnet framework apps via github actions on selfhosted runner, we have documentation for window-latest but not self hosted. Could you please help us on this.
What specific issues are you seeing? What have you tried?
Please include code snippets, minus proprietary information.
I have used the below code for sonar scanner but the build output comesup with warning (WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see SonarScanner for .NET | SonarQube Docs)
name: SonarQube CI
types: [opened, synchronize, reopened]
- uses: actions/checkout@v2
- name: SonarScanner for .NET 5
# The key of the SonarQube project
# The name of the SonarQube project
# Optional command arguments to dotnet build
I tried to follow the documentation (SonarScanner for .NET | SonarQube Docs) addressed and it worked in my local (as it is windows), but i wanted to convert them to Github actions, but its failing as our Sonar is self-hosted, I would need help for self-hosted runner for sonar integration to our dotnet framework app
What OS are the Github Runners?
it is linux
Could you please help on the above issues on dotnet framework apps
Sorry, I’m not familiar with linux and Sonar. Hopefully others on here can help.
It might be helpful to expand on which implementation and version of linux you are working with.
@Wildcat Thanks for collecting additional information! It really helps.
It looks like you’re trying to use
SonarSource/sonarqube-scan-action to analyze .NET code. This isn’t possible, as noted in the action.
In fact, when you create a new project in SonarQube, you should find a tutorial for GitHub Actions + .NET which will tell you how to configure your build.
I can’t quite find out how to access the tutorials for a project that has already been scanned (even if that scan was bogus) other than visiting http://<SONARQUBE_URL>/tutorials?id=<PROJECT_KEY> I’ll raise this point to the relevant team. If you can’t sort out the URL, you can create a new project.