-
Notifications
You must be signed in to change notification settings - Fork 0
Not sure why SonarQube isn't getting the test coverage... #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
96f9461
Not sure why SonarQube isn't getting the test coverage...
jbarden 64d57d4
Update main_astar-dev.yml
jbarden 94b310b
Found a better / different approach - in desc
jbarden c304bf6
Put back the permissions limit
jbarden 57f8760
Oh, c'mon!
jbarden a74fa28
Need to see how to contribute to SQ docs...
jbarden b0b2ab5
Update the filter to exclude Integration Tests too
jbarden 2c51bd6
Silly boy... FullyQualifiedName can't work if the project doesn't use...
jbarden d5e6698
it helps if a) actually fully qualified n b) remember to escape !
jbarden 3f28b1c
OK, let's try including Tests.Unit rather than excluding others
jbarden d870d14
ignore the 2 tests failing on GitHub but passing locally...
jbarden 211ac07
Hopefully, this is the last issue
jbarden 782b2b9
Yet another difference between SQ examples and apparent requirements
jbarden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,110 +1,51 @@ | ||
| name: Build and analyse the DatabaseTesting Solution | ||
| name: SonarQube | ||
| on: | ||
| pull_request: | ||
| types: [ opened, synchronize, reopened ] | ||
| push: | ||
| branches: | ||
| - main | ||
| env: | ||
| AZURE_WEBAPP_NAME: astar-dev | ||
| AZURE_WEBAPP_PACKAGE_PATH: src/uis/AStar.Dev.Web/published | ||
| CONFIGURATION: Release | ||
| DOTNET_CORE_VERSION: 9.0.x | ||
| WORKING_DIRECTORY: src/uis/AStar.Dev.Web | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| jobs: | ||
| build: | ||
| name: Build and analyze | ||
| runs-on: windows-latest | ||
| permissions: | ||
| contents: read #This is required for actions/checkout | ||
|
|
||
| steps: | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: 17 | ||
| distribution: 'zulu' | ||
|
|
||
| distribution: 'zulu' # Alternative distribution options are available. | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
|
||
| - name: 🛠 Cache SonarQube Cloud packages | ||
| - name: Cache SonarQube Cloud packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~\sonar\cache | ||
| key: ${{ runner.os }}-sonar | ||
| restore-keys: ${{ runner.os }}-sonar | ||
|
|
||
| - name: 🛠 Cache SonarQube Cloud scanner | ||
| - name: Cache SonarQube Cloud scanner | ||
| id: cache-sonar-scanner | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: .\.sonar\scanner | ||
| key: ${{ runner.os }}-sonar-scanner | ||
| restore-keys: ${{ runner.os }}-sonar-scanner | ||
|
|
||
| - name: 🛠 Install SonarQube Cloud scanner | ||
| - name: Install SonarQube Cloud scanner | ||
| if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | ||
| shell: powershell | ||
| run: | | ||
| New-Item -Path .\.sonar\scanner -ItemType Directory | ||
| New-Item -Path .\.sonar\scanner -ItemType Directory | ||
| dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner | ||
| - name: 🔍 Restore, | ||
| shell: powershell | ||
| run: | | ||
| dotnet restore | ||
| - name: 🛠 Build | ||
| shell: powershell | ||
| run: | | ||
| dotnet build --no-restore | ||
| - name: 🧪 Test and analyse with ☁️ SonarCloud / Qube | ||
| - name: Build and analyze | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| shell: powershell | ||
| run: | | ||
| dotnet tool install --global dotnet-coverage | ||
| .\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_astar-dev-database-testing" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.scanner.scanAll=false /d:sonar.scanner.skipJreProvisioning=true | ||
| dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Tests.EndToEnd"' -f xml -o 'coverage.xml' | ||
| .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | ||
| # | ||
| # - name: 🚀 Publish App | ||
| # run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}" | ||
| # | ||
| # - name: 🚀 Publish Artifacts | ||
| # uses: actions/upload-artifact@v4 | ||
| # with: | ||
| # name: webapp | ||
| # path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
|
|
||
| # deploy: | ||
| # runs-on: ubuntu-latest | ||
| # needs: build | ||
| # environment: | ||
| # name: 'Production' | ||
| # url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | ||
| # permissions: | ||
| # id-token: write #This is required for requesting the JWT | ||
| # contents: read #This is required for actions/checkout | ||
| # | ||
| # steps: | ||
| # - name: Download artifact from build job | ||
| # uses: actions/download-artifact@v4 | ||
| # with: | ||
| # name: webapp | ||
| # path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
| # | ||
| # - name: Login to Azure | ||
| # uses: azure/login@v2 | ||
| # with: | ||
| # client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E8497C9E217E4655814D0F7761AAE04F }} | ||
| # tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_085200BD39F041C4999EEB0851E8D6A2 }} | ||
| # subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3FEB324333C140D8A0FA99AC083AEB82 }} | ||
| # | ||
| # - name: Deploy to Azure WebApp | ||
| # uses: azure/webapps-deploy@v3 | ||
| # with: | ||
| # app-name: ${{ env.AZURE_WEBAPP_NAME }} | ||
| # package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
| dotnet sonarscanner begin /k:"astar-development_astar-dev-database-testing" | ||
| /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | ||
| /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml | ||
| dotnet build --no-incremental | ||
| dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml" | ||
| dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.