Skip to content

Commit

Permalink
config: fix sonarcloud settings
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-sergio committed Apr 19, 2024
1 parent 0ad4368 commit 9de7346
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ jobs:
shell: powershell
run: |
cd users-microservice
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
Write-Host "SONAR SCANNER BEGIN ---------------"
..\.sonar\scanner\dotnet-sonarscanner begin /k:"i-am-sergio_enrollapp" /o:"i-am-sergio" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io /d:sonar.cs.opencover.reportsPaths="**/coverage.cobertura.xml"
..\.sonar\scanner\dotnet-sonarscanner begin /k:"i-am-sergio_enrollapp" /o:"i-am-sergio" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io /d:sonar.cs.opencover.reportsPaths="**/test/coverage.opencover.xml"
dotnet build
dotnet test
Write-Host "SONAR SCANNER END ---------------"
..\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
10 changes: 9 additions & 1 deletion users-microservice/some.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ sonar.test.inclusions=**/*Test.cs
sonar.binaries=**/bin/**
sonar.cs.opencover.reportsPaths=**/coverage.cobertura.xml
sonar.exclusions=**/*Test.cs,Dockerfile
sonar.sourceEncoding=UTF-8
sonar.sourceEncoding=UTF-8


dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

dotnet sonarscanner begin /o:"unsa" /k:"unsa_enroll-system" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token="73029d341e4a26f3aec5a865f1cfa096d1e83cd9" /d:sonar.cs.opencover.reportsPaths="**/test/coverage.opencover.xml"

dotnet build
dotnet sonarscanner end /d:sonar.token="73029d341e4a26f3aec5a865f1cfa096d1e83cd9"
3 changes: 1 addition & 2 deletions users-microservice/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
using users_microservice.services;

var builder = WebApplication.CreateBuilder(args);
//var url = builder.Configuration["AppSettings:BaseUrl"];
//builder.WebHost.UseUrls(url);

builder.Services.AddSingleton<IUserService, UserService>();
builder.Services.AddControllers();

Expand Down
1 change: 1 addition & 0 deletions users-microservice/src/controller/userController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public interface IUserController
}

[ApiController]
[Route("[controller]")]
public class UserController : ControllerBase, IUserController
{
private readonly IUserService _userService;
Expand Down
2 changes: 1 addition & 1 deletion users-microservice/src/services/userService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface IUserService

public class UserService : IUserService
{
private static int nextId = 3;
private int nextId = 3;
private static List<UserModel> Users = new List<UserModel>
{
new UserModel
Expand Down

0 comments on commit 9de7346

Please sign in to comment.