diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4f285ebbd..5ba2e0fae 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -32,8 +32,8 @@ jobs: restore-keys: ${{ runner.os }}-sonar - name: Install SonarCloud scanners run: dotnet tool install --global dotnet-sonarscanner - - name: Install dotnet-coverage - run: dotnet tool install --global dotnet-coverage + - name: Install dotnet reportgenerator + run: dotnet tool install --global dotnet-reportgenerator-globaltool - name: Restore dependencies run: dotnet restore - name: Setup node.js @@ -48,7 +48,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - dotnet-sonarscanner begin /k:"DFE-Digital_academy-transfers-api" /o:"dfe-digital" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" + dotnet-sonarscanner begin /k:"DFE-Digital_academy-transfers-api" /o:"dfe-digital" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml dotnet build -c Release --no-restore - dotnet test -c Release --no-build --verbosity normal + dotnet test -c Release --no-build --verbosity normal --collect:"XPlat Code Coverage" + reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:./CoverageReport -reporttypes:SonarQube dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"