From 75493ba895a4ac5a87666dc3f3ed41a4e52dde66 Mon Sep 17 00:00:00 2001 From: Bertrand THOMAS Date: Wed, 25 Feb 2026 15:57:47 +0100 Subject: [PATCH 1/5] Update dotnet quality to trx test results --- actions/dotnet/build-test-sonar/action.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/actions/dotnet/build-test-sonar/action.yml b/actions/dotnet/build-test-sonar/action.yml index 5826723..ec85026 100644 --- a/actions/dotnet/build-test-sonar/action.yml +++ b/actions/dotnet/build-test-sonar/action.yml @@ -60,10 +60,15 @@ runs: shell: bash - name: Start code analysis run: | - ./.sonar/scanner/dotnet-sonarscanner begin /k:"${{ inputs.sonar-project-key }}" /o:"${{ inputs.sonar-organization }}" \ - /n:"${{ inputs.sonar-project-name }}" /d:sonar.token="${{ inputs.sonar-token}}" /d:sonar.host.url="${{ inputs.sonar-host-url }}" \ - /d:sonar.cpd.exclusions="**/*Generated*.cs,${{ inputs.report-folder }}/**" /d:sonar.exclusions="${{ inputs.report-folder }}/**/*" \ - /d:sonar.coverageReportPaths="${{ inputs.report-folder }}/SonarQube.xml" + ./.sonar/scanner/dotnet-sonarscanner begin \ + /k:"${{ inputs.sonar-project-key }}" \ + /o:"${{ inputs.sonar-organization }}" \ + /n:"${{ inputs.sonar-project-name }}" \ + /d:sonar.token="${{ inputs.sonar-token}}" \ + /d:sonar.host.url="${{ inputs.sonar-host-url }}" \ + /d:sonar.cpd.exclusions="**/*Generated*.cs,${{ inputs.report-folder }}/**" \ + /d:sonar.exclusions="${{ inputs.report-folder }}/**/*" \ + /d:sonar.coverageReportPaths="${{ inputs.report-folder }}/TestResults/test-results.trx" shell: bash - name: Build .NET solution run: dotnet build --no-restore --configuration Debug @@ -71,8 +76,9 @@ runs: - name: Run tests run: | dotnet test --no-build --verbosity normal --configuration Debug \ - --logger:"junit;LogFilePath=..\..\artifacts\{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose" \ - --collect:"XPlat Code Coverage" + --results-directory "${{ inputs.report-folder }}/TestResults" \ + --report-xunit-trx --report-xunit-trx-filename "test-results.trx" \ + --coverage --coverage-output-format cobertura shell: bash env: ASPNETCORE_ENVIRONMENT: Development From b39bbe338b683bd14c3a1767497c2a736f46dcf6 Mon Sep 17 00:00:00 2001 From: Bertrand THOMAS Date: Wed, 25 Feb 2026 16:13:29 +0100 Subject: [PATCH 2/5] Update report folder --- actions/dotnet/build-test-sonar/action.yml | 7 ++++--- actions/dotnet/install-lint-restore/action.yml | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/actions/dotnet/build-test-sonar/action.yml b/actions/dotnet/build-test-sonar/action.yml index ec85026..0ac72db 100644 --- a/actions/dotnet/build-test-sonar/action.yml +++ b/actions/dotnet/build-test-sonar/action.yml @@ -68,7 +68,8 @@ runs: /d:sonar.host.url="${{ inputs.sonar-host-url }}" \ /d:sonar.cpd.exclusions="**/*Generated*.cs,${{ inputs.report-folder }}/**" \ /d:sonar.exclusions="${{ inputs.report-folder }}/**/*" \ - /d:sonar.coverageReportPaths="${{ inputs.report-folder }}/TestResults/test-results.trx" + /d:sonar.coverageReportPaths="${{ inputs.report-folder }}/SonarQube.xml" \ + /d:sonar.cs.vstest.reportsPaths="${{ inputs.report-folder }}/TestResults/test-results.trx" shell: bash - name: Build .NET solution run: dotnet build --no-restore --configuration Debug @@ -78,13 +79,13 @@ runs: dotnet test --no-build --verbosity normal --configuration Debug \ --results-directory "${{ inputs.report-folder }}/TestResults" \ --report-xunit-trx --report-xunit-trx-filename "test-results.trx" \ - --coverage --coverage-output-format cobertura + --coverage --coverage-output-format cobertura --coverage-output "coverage.cobertura.xml" shell: bash env: ASPNETCORE_ENVIRONMENT: Development - name: Generate test report run: | - reportgenerator "-reports:./test/*/TestResults/*/coverage.cobertura.xml" \ + reportgenerator "-reports:${{ inputs.report-folder }}/TestResults/coverage.cobertura.xml" \ "-targetdir:${{ inputs.report-folder }}" \ "-reporttypes:Cobertura;Html;TextSummary;SonarQube" shell: bash diff --git a/actions/dotnet/install-lint-restore/action.yml b/actions/dotnet/install-lint-restore/action.yml index 87679a8..41ab806 100644 --- a/actions/dotnet/install-lint-restore/action.yml +++ b/actions/dotnet/install-lint-restore/action.yml @@ -23,9 +23,9 @@ runs: dotnet tool install --global dotnet-reportgenerator-globaltool export PATH="$PATH:/root/.dotnet/tools" shell: bash - - name: Lint .NET code - run: dotnet format --verify-no-changes --severity warn --verbosity:diagnostic - shell: bash - name: Restore .NET packages run: dotnet restore shell: bash + - name: Lint .NET code + run: dotnet format --verify-no-changes --severity warn --verbosity:diagnostic + shell: bash From fd93f0993aadc3e0630fa2b91facae0d8d0a426f Mon Sep 17 00:00:00 2001 From: Bertrand THOMAS Date: Wed, 25 Feb 2026 16:32:22 +0100 Subject: [PATCH 3/5] Manage multiple test projects --- actions/dotnet/build-test-sonar/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actions/dotnet/build-test-sonar/action.yml b/actions/dotnet/build-test-sonar/action.yml index 0ac72db..3d9331d 100644 --- a/actions/dotnet/build-test-sonar/action.yml +++ b/actions/dotnet/build-test-sonar/action.yml @@ -69,7 +69,7 @@ runs: /d:sonar.cpd.exclusions="**/*Generated*.cs,${{ inputs.report-folder }}/**" \ /d:sonar.exclusions="${{ inputs.report-folder }}/**/*" \ /d:sonar.coverageReportPaths="${{ inputs.report-folder }}/SonarQube.xml" \ - /d:sonar.cs.vstest.reportsPaths="${{ inputs.report-folder }}/TestResults/test-results.trx" + /d:sonar.cs.vstest.reportsPaths="${{ inputs.report-folder }}/TestResults/*.trx" shell: bash - name: Build .NET solution run: dotnet build --no-restore --configuration Debug @@ -78,14 +78,14 @@ runs: run: | dotnet test --no-build --verbosity normal --configuration Debug \ --results-directory "${{ inputs.report-folder }}/TestResults" \ - --report-xunit-trx --report-xunit-trx-filename "test-results.trx" \ - --coverage --coverage-output-format cobertura --coverage-output "coverage.cobertura.xml" + --report-xunit-trx \ + --coverage --coverage-output-format cobertura shell: bash env: ASPNETCORE_ENVIRONMENT: Development - name: Generate test report run: | - reportgenerator "-reports:${{ inputs.report-folder }}/TestResults/coverage.cobertura.xml" \ + reportgenerator "-reports:${{ inputs.report-folder }}/TestResults/*.cobertura.xml" \ "-targetdir:${{ inputs.report-folder }}" \ "-reporttypes:Cobertura;Html;TextSummary;SonarQube" shell: bash From 075662781f4dc94fcff1eb224defaaabe442a8cf Mon Sep 17 00:00:00 2001 From: Bertrand THOMAS Date: Wed, 25 Feb 2026 18:09:39 +0100 Subject: [PATCH 4/5] Add fossa timeout and make it not blocking --- .github/workflows/reusable-dotnet-quality.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-dotnet-quality.yml b/.github/workflows/reusable-dotnet-quality.yml index 00ff5f1..fd6cd77 100644 --- a/.github/workflows/reusable-dotnet-quality.yml +++ b/.github/workflows/reusable-dotnet-quality.yml @@ -137,14 +137,16 @@ jobs: if: ${{ inputs.fossa-enabled }} uses: fossas/fossa-action@v1.8.0 id: fossa + continue-on-error: true + timeout-minutes: 3 with: api-key: "${{ secrets.fossa-api-key }}" run-tests: ${{ inputs.fossa-test && github.event_name == 'pull_request' }} test-diff-revision: ${{ github.event.pull_request.base.sha }} generate-report: html - name: Create FOSSA report file + if: ${{ inputs.fossa-enabled && steps.fossa.outputs.report != '' }} run: echo '${{ steps.fossa.outputs.report }}' > report/fossa.html - if: ${{ inputs.fossa-enabled }} - name: Generate SBOM with Syft uses: anchore/sbom-action@v0 # with: From ca6ef23e5c140af6fd645e6ae3b07116dfdcfb97 Mon Sep 17 00:00:00 2001 From: Bertrand THOMAS Date: Wed, 25 Feb 2026 20:13:21 +0100 Subject: [PATCH 5/5] Add comment --- .github/workflows/reusable-dotnet-quality.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable-dotnet-quality.yml b/.github/workflows/reusable-dotnet-quality.yml index fd6cd77..5ff8b77 100644 --- a/.github/workflows/reusable-dotnet-quality.yml +++ b/.github/workflows/reusable-dotnet-quality.yml @@ -137,6 +137,7 @@ jobs: if: ${{ inputs.fossa-enabled }} uses: fossas/fossa-action@v1.8.0 id: fossa + # https://status.fossa.com/ continue-on-error: true timeout-minutes: 3 with: