Update #47
This file contains 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
name: Sonarqube Analysis | |
env: | |
NET_VERSION: '7.x' | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST: https://sonarcloud.io | |
SONAR_ORGANIZATION: maurosoft1973 | |
SONAR_PROJECT: maurosoft1973_FileSystem | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'master' | |
- 'develop' | |
jobs: | |
quality: | |
name: Sonarqube Analysis | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
- name: Run Analysis | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: maurosoft1973/alpine-net-sonarqube-scanner | |
options: -v ${{ github.workspace }}:/source | |
run: | | |
/scripts/run-alpine-sonarqube-scanner.sh | |
export DOTNET_ROOT=/root/.dotnet | |
export PATH=$PATH:$DOTNET_ROOT:/scripts | |
cd /source | |
dotnet sonarscanner begin /o:"${{ env.SONAR_ORGANIZATION }}" /k:"${{ env.SONAR_PROJECT }}" /d:sonar.token="${{ env.SONAR_TOKEN }}" /d:sonar.host.url="${{ env.SONAR_HOST }}" /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="${{ env.SONAR_TOKEN }}" | |