From 725f8fa55317b057d4bcac7891aaecc22820facf Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 31 May 2023 10:37:41 +0200 Subject: [PATCH 1/7] pipelines --- .azuredevops/Pipelines/build.yaml | 59 +++++++++++------------- .azuredevops/Pipelines/pull-request.yaml | 29 ++++++++++-- 2 files changed, 51 insertions(+), 37 deletions(-) diff --git a/.azuredevops/Pipelines/build.yaml b/.azuredevops/Pipelines/build.yaml index 079cc248..145088a0 100644 --- a/.azuredevops/Pipelines/build.yaml +++ b/.azuredevops/Pipelines/build.yaml @@ -107,6 +107,18 @@ stages: command: 'restore' projects: '**/*.csproj' + - task: SonarCloudPrepare@1 + displayName: Prepare analysis on SonarCloud + inputs: + SonarCloud: SonarCloud + organization: CoenM + projectKey: RepoM + projectName: RepoM + extraProperties: | + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml + sonar.branch.name=$(Build.SourceBranchName) + - task: DotNetCoreCLI@2 displayName: "DotNet Build" inputs: @@ -116,13 +128,23 @@ stages: # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core?view=azure-devops&tabs=dotnetfive - task: DotNetCoreCLI@2 - displayName: "DotNet Test" + displayName: "Dotnet Test" inputs: command: test projects: 'tests/**/*.csproj' - arguments: '--no-build --configuration $(BuildConfiguration) --collect:"XPlat Code Coverage" --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:ExcludeByAttribute=$(COVERLET_EXCLUDE_ATTRIBUTE) /p:ExcludeByFile=*\*Designer.cs /p:CoverletOutput=../_CoverageResults/ /p:MergeWith="../_CoverageResults/coverage.json" /p:CoverletOutputFormat=cobertura%2cjson' + arguments: >- + --no-build --configuration $(buildConfiguration) + --collect:"XPlat Code Coverage;Format=cobertura,opencover" + --logger trx + /p:ExcludeByAttribute=CompilerGenerated publishTestResults: true - + + - task: SonarCloudAnalyze@1 + displayName: Run Code Analysis + + - task: SonarCloudPublish@1 + displayName: Publish Quality Gate Result + # https://docs.codecov.com/docs/codecov-uploader # todo fix path # ./codecov.exe -f "../**/coverag*.cobertura.xml" @@ -160,16 +182,6 @@ stages: modifyOutputPath: false zipAfterPublish: false - # - task: DotNetCoreCLI@2 - # displayName: "Dotnet Publish grr tool" - # inputs: - # command: publish - # arguments: "--configuration $(buildConfiguration) --output _output/Win/Assemblies --self-contained true --runtime win-x64" - # projects: "**/Grr.App.csproj" - # publishWebProjects: false - # modifyOutputPath: false - # zipAfterPublish: false - - task: DeleteFiles@1 displayName: 'Remove unneeded files' inputs: @@ -195,26 +207,7 @@ stages: # PathtoPublish: "$(Build.ArtifactStagingDirectory)" PathtoPublish: "_output" ArtifactName: installer - - # - pwsh: | - # dotnet tool install --tool-path . dotnet-reportgenerator-globaltool - # ./reportgenerator "-reports:**/coverag*.cobertura.xml" "-targetdir:$(Agent.TempDirectory)" "-reporttypes:Cobertura" - # displayName: Merge coverage reports - # name: MergeCoverageReports - - # - task: PublishCodeCoverageResults@1 - # displayName: 'Publish code coverage to devops' - # inputs: - # codeCoverageTool: Cobertura - # summaryFileLocation: '$(Agent.TempDirectory)/Cobertura.xml' - - # - task: DotNetCoreCLI@2 - # displayName: 'DotNet Pack' - # inputs: - # command: pack - # configuration: $(BuildConfiguration) - # nobuild: false - # includesymbols: true + # - task: CopyFiles@2 # displayName: "Copy files to artifact" diff --git a/.azuredevops/Pipelines/pull-request.yaml b/.azuredevops/Pipelines/pull-request.yaml index ba422c72..00ef0cfa 100644 --- a/.azuredevops/Pipelines/pull-request.yaml +++ b/.azuredevops/Pipelines/pull-request.yaml @@ -97,10 +97,31 @@ stages: projects: '**/*.sln' arguments: '--configuration $(BuildConfiguration)' + - task: SonarCloudPrepare@1 + displayName: Prepare analysis on SonarCloud + inputs: + SonarCloud: SonarCloud + organization: CoenM + projectKey: RepoM + projectName: RepoM + extraProperties: | + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml + - task: DotNetCoreCLI@2 - displayName: "DotNet Test" + displayName: "Dotnet Test" inputs: command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--no-build --configuration $(BuildConfiguration)' - \ No newline at end of file + projects: 'tests/**/*.csproj' + arguments: >- + --no-build --configuration $(buildConfiguration) + --collect:"XPlat Code Coverage;Format=cobertura,opencover" + --logger trx + /p:ExcludeByAttribute=CompilerGenerated + publishTestResults: true + + - task: SonarCloudAnalyze@1 + displayName: Run Code Analysis + + - task: SonarCloudPublish@1 + displayName: Publish Quality Gate Result \ No newline at end of file From 65bdbde03027e14db99b9ce032bf1dbee291dba3 Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 31 May 2023 11:13:20 +0200 Subject: [PATCH 2/7] update --- .azuredevops/Pipelines/build.yaml | 2 +- .azuredevops/Pipelines/pull-request.yaml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.azuredevops/Pipelines/build.yaml b/.azuredevops/Pipelines/build.yaml index 145088a0..953b117c 100644 --- a/.azuredevops/Pipelines/build.yaml +++ b/.azuredevops/Pipelines/build.yaml @@ -110,7 +110,7 @@ stages: - task: SonarCloudPrepare@1 displayName: Prepare analysis on SonarCloud inputs: - SonarCloud: SonarCloud + SonarCloud: SonarCloudGithub organization: CoenM projectKey: RepoM projectName: RepoM diff --git a/.azuredevops/Pipelines/pull-request.yaml b/.azuredevops/Pipelines/pull-request.yaml index 00ef0cfa..ff03f7fd 100644 --- a/.azuredevops/Pipelines/pull-request.yaml +++ b/.azuredevops/Pipelines/pull-request.yaml @@ -90,23 +90,23 @@ stages: command: 'restore' projects: '**/*.csproj' - - task: DotNetCoreCLI@2 - displayName: "DotNet Build" - inputs: - command: 'build' - projects: '**/*.sln' - arguments: '--configuration $(BuildConfiguration)' - - task: SonarCloudPrepare@1 displayName: Prepare analysis on SonarCloud inputs: - SonarCloud: SonarCloud + SonarCloud: SonarCloudGithub organization: CoenM projectKey: RepoM projectName: RepoM extraProperties: | sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml + + - task: DotNetCoreCLI@2 + displayName: "DotNet Build" + inputs: + command: 'build' + projects: '**/*.sln' + arguments: '--configuration $(BuildConfiguration)' - task: DotNetCoreCLI@2 displayName: "Dotnet Test" From 30edd98b79caabd00b52c2fdc91906da54a5d6ed Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 31 May 2023 11:20:06 +0200 Subject: [PATCH 3/7] coenm-github --- .azuredevops/Pipelines/build.yaml | 2 +- .azuredevops/Pipelines/pull-request.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azuredevops/Pipelines/build.yaml b/.azuredevops/Pipelines/build.yaml index 953b117c..6c3cff45 100644 --- a/.azuredevops/Pipelines/build.yaml +++ b/.azuredevops/Pipelines/build.yaml @@ -111,7 +111,7 @@ stages: displayName: Prepare analysis on SonarCloud inputs: SonarCloud: SonarCloudGithub - organization: CoenM + organization: coenm-github projectKey: RepoM projectName: RepoM extraProperties: | diff --git a/.azuredevops/Pipelines/pull-request.yaml b/.azuredevops/Pipelines/pull-request.yaml index ff03f7fd..a3050cc2 100644 --- a/.azuredevops/Pipelines/pull-request.yaml +++ b/.azuredevops/Pipelines/pull-request.yaml @@ -94,7 +94,7 @@ stages: displayName: Prepare analysis on SonarCloud inputs: SonarCloud: SonarCloudGithub - organization: CoenM + organization: coenm-github projectKey: RepoM projectName: RepoM extraProperties: | From 678648b1e2dea1de3aa6a19caa34113a14c39aaa Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 31 May 2023 12:17:29 +0200 Subject: [PATCH 4/7] remove sonar.branch.name=$(Build.SourceBranchName) --- .azuredevops/Pipelines/build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azuredevops/Pipelines/build.yaml b/.azuredevops/Pipelines/build.yaml index 6c3cff45..ec9875af 100644 --- a/.azuredevops/Pipelines/build.yaml +++ b/.azuredevops/Pipelines/build.yaml @@ -117,7 +117,6 @@ stages: extraProperties: | sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml - sonar.branch.name=$(Build.SourceBranchName) - task: DotNetCoreCLI@2 displayName: "DotNet Build" From d95e79436b5f88b6ab18b7aa228541b0ace865e0 Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 31 May 2023 12:19:41 +0200 Subject: [PATCH 5/7] cleanup --- .azuredevops/Pipelines/build.yaml | 8 ++++---- .azuredevops/Pipelines/pull-request.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.azuredevops/Pipelines/build.yaml b/.azuredevops/Pipelines/build.yaml index ec9875af..c188da18 100644 --- a/.azuredevops/Pipelines/build.yaml +++ b/.azuredevops/Pipelines/build.yaml @@ -104,7 +104,7 @@ stages: - task: DotNetCoreCLI@2 displayName: DotNet Restore inputs: - command: 'restore' + command: restore projects: '**/*.csproj' - task: SonarCloudPrepare@1 @@ -119,15 +119,15 @@ stages: sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml - task: DotNetCoreCLI@2 - displayName: "DotNet Build" + displayName: DotNet Build inputs: - command: 'build' + command: build projects: '**/*.sln' arguments: '--configuration $(BuildConfiguration)' # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core?view=azure-devops&tabs=dotnetfive - task: DotNetCoreCLI@2 - displayName: "Dotnet Test" + displayName: Dotnet Test inputs: command: test projects: 'tests/**/*.csproj' diff --git a/.azuredevops/Pipelines/pull-request.yaml b/.azuredevops/Pipelines/pull-request.yaml index a3050cc2..f1b160e2 100644 --- a/.azuredevops/Pipelines/pull-request.yaml +++ b/.azuredevops/Pipelines/pull-request.yaml @@ -87,7 +87,7 @@ stages: - task: DotNetCoreCLI@2 displayName: DotNet Restore inputs: - command: 'restore' + command: restore projects: '**/*.csproj' - task: SonarCloudPrepare@1 @@ -102,14 +102,14 @@ stages: sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.opencover.xml - task: DotNetCoreCLI@2 - displayName: "DotNet Build" + displayName: DotNet Build inputs: - command: 'build' + command: build projects: '**/*.sln' arguments: '--configuration $(BuildConfiguration)' - task: DotNetCoreCLI@2 - displayName: "Dotnet Test" + displayName: Dotnet Test inputs: command: test projects: 'tests/**/*.csproj' From c2005c42b50ab17af789d66c7920871610b5afe4 Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 31 May 2023 12:45:01 +0200 Subject: [PATCH 6/7] readme --- README.source.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.source.md b/README.source.md index fa4aedcc..e08393c0 100644 --- a/README.source.md +++ b/README.source.md @@ -1,5 +1,7 @@ # RepoM +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=RepoM&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=RepoM) + RepoM is a minimal-conf git repository hub. It uses the git repositories on your machine to create an efficient navigation widget and makes sure you'll never lose track of your work along the way. It's populating itself as you work with git. It does not get in the way and only requires minimal effort to configure. From b98647a2cc5e3ca1b08be5227e919a5a695089db Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 31 May 2023 10:45:49 +0000 Subject: [PATCH 7/7] Docs changes --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fa4aedcc..e08393c0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # RepoM +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=RepoM&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=RepoM) + RepoM is a minimal-conf git repository hub. It uses the git repositories on your machine to create an efficient navigation widget and makes sure you'll never lose track of your work along the way. It's populating itself as you work with git. It does not get in the way and only requires minimal effort to configure.