From bacea40034df070abfd0f374a07aa72f7c022195 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sun, 28 Jun 2026 11:08:48 +0200 Subject: [PATCH 1/2] Enable SonarCloud analysis (true / false) --- .github/workflows/ci.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79f0fba2..e9c17af9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,16 @@ name: Build with Tests on: - push: - workflow_dispatch: - pull_request: - types: [opened, edited] + push: + workflow_dispatch: + inputs: + SonarScanner: + description: 'Enable SonarCloud analysis' + type: boolean + required: false + default: true + pull_request: + types: [opened, edited] jobs: build_and_test_Windows: @@ -69,10 +75,10 @@ jobs: fi - name: Begin analysis on SonarCloud - if: ${{ steps.secret-check.outputs.run_analysis == 'true' }} + if: ${{ steps.secret-check.outputs.run_analysis == 'true' && inputs.SonarScanner }} run: | dotnet sonarscanner begin /k:"zzzprojects_System.Linq.Dynamic.Core" /o:"zzzprojects" /d:sonar.branch.name=$BranchName /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token=${{ secrets.SONAR_TOKEN }} /d:sonar.pullrequest.provider=github /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.vscoveragexml.reportsPaths=**/dynamic-coverage-*.xml /d:sonar.verbose=true - + - name: Build run: | dotnet build ./src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj -c Debug -p:buildType=azure-pipelines-ci @@ -94,6 +100,6 @@ jobs: dotnet-coverage collect 'dotnet test ./test/System.Linq.Dynamic.Core.SystemTextJson.Tests/System.Linq.Dynamic.Core.SystemTextJson.Tests.csproj --configuration Debug --framework net10.0 -p:buildType=azure-pipelines-ci' -f xml -o dynamic-coverage-systemtextjson.xml - name: End analysis on SonarCloud - if: ${{ steps.secret-check.outputs.run_analysis == 'true' }} + if: ${{ steps.secret-check.outputs.run_analysis == 'true' && inputs.SonarScanner }} run: | - dotnet sonarscanner end /d:sonar.token=${{ secrets.SONAR_TOKEN }} \ No newline at end of file + dotnet sonarscanner end /d:sonar.token=${{ secrets.SONAR_TOKEN }} From 0324aa8443141c3926c6f109bdb9a16060c97e11 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sun, 28 Jun 2026 11:24:55 +0200 Subject: [PATCH 2/2] workflow_dispatch --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9c17af9..ed906141 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: fi - name: Begin analysis on SonarCloud - if: ${{ steps.secret-check.outputs.run_analysis == 'true' && inputs.SonarScanner }} + if: ${{ steps.secret-check.outputs.run_analysis == 'true' && (github.event_name != 'workflow_dispatch' || inputs.SonarScanner) }} run: | dotnet sonarscanner begin /k:"zzzprojects_System.Linq.Dynamic.Core" /o:"zzzprojects" /d:sonar.branch.name=$BranchName /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token=${{ secrets.SONAR_TOKEN }} /d:sonar.pullrequest.provider=github /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.vscoveragexml.reportsPaths=**/dynamic-coverage-*.xml /d:sonar.verbose=true @@ -100,6 +100,6 @@ jobs: dotnet-coverage collect 'dotnet test ./test/System.Linq.Dynamic.Core.SystemTextJson.Tests/System.Linq.Dynamic.Core.SystemTextJson.Tests.csproj --configuration Debug --framework net10.0 -p:buildType=azure-pipelines-ci' -f xml -o dynamic-coverage-systemtextjson.xml - name: End analysis on SonarCloud - if: ${{ steps.secret-check.outputs.run_analysis == 'true' && inputs.SonarScanner }} + if: ${{ steps.secret-check.outputs.run_analysis == 'true' && (github.event_name != 'workflow_dispatch' || inputs.SonarScanner) }} run: | dotnet sonarscanner end /d:sonar.token=${{ secrets.SONAR_TOKEN }}