diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2eb20414..c7c9645d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -64,58 +64,22 @@ jobs: - name: Dotnet Build Audit.NET.sln run: dotnet build .\Audit.NET.sln --no-restore --configuration release - #- name: Test Audit.IntegrationTest (AzureDocDb) - # run: dotnet test .\test\Audit.IntegrationTest --no-build --configuration release --verbosity normal --filter="TestCategory=AzureDocDb" - # env: - # AUDIT_NET_AZUREDOCDBAUTHKEY: ${{ secrets.AUDIT_NET_AZUREDOCDBAUTHKEY }} - # AUDIT_NET_AZUREDOCDBURL: ${{ secrets.AUDIT_NET_AZUREDOCDBURL }} - # AUDIT_NET_AZURETABLECNNSTRING: ${{ secrets.AUDIT_NET_AZURETABLECNNSTRING }} - # AUDIT_NET_AZUREBLOBSERVICEURL: ${{ secrets.AUDIT_NET_AZUREBLOBSERVICEURL }} - # AUDIT_NET_AZUREBLOBACCOUNTNAME: ${{ secrets.AUDIT_NET_AZUREBLOBACCOUNTNAME }} - # AUDIT_NET_AZUREBLOBACCOUNTKEY: ${{ secrets.AUDIT_NET_AZUREBLOBACCOUNTKEY }} - - #- name: Test Audit.IntegrationTest (AzureStorage) - # run: dotnet test .\test\Audit.IntegrationTest --no-build --configuration release --verbosity normal --filter="TestCategory=AzureBlob|TestCategory=AzureStorageBlobs|TestCategory=AzureTables" - # env: - # AUDIT_NET_AZUREDOCDBAUTHKEY: ${{ secrets.AUDIT_NET_AZUREDOCDBAUTHKEY }} - # AUDIT_NET_AZUREDOCDBURL: ${{ secrets.AUDIT_NET_AZUREDOCDBURL }} - # AUDIT_NET_AZURETABLECNNSTRING: ${{ secrets.AUDIT_NET_AZURETABLECNNSTRING }} - # AUDIT_NET_AZUREBLOBSERVICEURL: ${{ secrets.AUDIT_NET_AZUREBLOBSERVICEURL }} - # AUDIT_NET_AZUREBLOBACCOUNTNAME: ${{ secrets.AUDIT_NET_AZUREBLOBACCOUNTNAME }} - # AUDIT_NET_AZUREBLOBACCOUNTKEY: ${{ secrets.AUDIT_NET_AZUREBLOBACCOUNTKEY }} - # AUDIT_NET_AZUREBLOBCNNSTRING: ${{ secrets.AUDIT_NET_AZUREBLOBCNNSTRING }} - - - name: Test Audit.EntityFramework.Core.UnitTest - run: dotnet test .\test\Audit.EntityFramework.Core.UnitTest --no-build --configuration release --verbosity normal - - #- name: Test Audit.AzureStorageTables.UnitTest - # run: dotnet test .\test\Audit.AzureStorageTables.UnitTest --no-build --configuration release --verbosity normal - # env: - # AUDIT_NET_AZURETABLECNNSTRING: ${{ secrets.AUDIT_NET_AZURETABLECNNSTRING }} + - name: Install Required Tools + run: | + dotnet new tool-manifest + dotnet tool install dotnet-reportgenerator-globaltool + dotnet tool install dotnet-coverage - - name: Test Audit.EntityFramework.Full.UnitTest - run: dotnet test .\test\Audit.EntityFramework.Full.UnitTest --no-build --configuration release --verbosity normal - - - name: Test Audit.Mvc.UnitTest - run: dotnet test .\test\Audit.Mvc.UnitTest --no-build --configuration release --verbosity normal + - name: Run unit tests + run: | + dotnet coverage collect dotnet test -m:1 --output ${{ github.workspace }}/Tests/Coverage.cobertura.xml --output-format cobertura - - name: Test Audit.JsonAdapter.UnitTest - run: dotnet test .\test\Audit.JsonAdapter.UnitTest --no-build --configuration release --verbosity normal - - - name: Test Audit.WebApi.UnitTest - run: dotnet test .\test\Audit.WebApi.UnitTest --no-build --configuration release --verbosity normal - - - name: Test Audit.DynamicProxy.UnitTest - run: dotnet test .\test\Audit.DynamicProxy.UnitTest --no-build --configuration release --verbosity normal - - - name: Test Audit.Wcf.UnitTest - run: dotnet test .\test\Audit.Wcf.UnitTest --no-build --configuration release --verbosity normal - - - name: Test Audit.Wcf.Client.UnitTest - run: dotnet test .\test\Audit.Wcf.Client.UnitTest --no-build --configuration release --verbosity normal - - - name: Test Audit.UnitTest - run: dotnet test .\test\Audit.UnitTest --no-build --configuration release --verbosity normal - + - name: Generate Code Coverage Report + run: | + dotnet reportgenerator -reports:${{ github.workspace }}/Tests/Coverage.cobertura.xml -targetdir:"${{ github.workspace }}/Tests/coveragereport" -reporttypes:"MarkdownSummary;Html" "-assemblyfilters:-*UnitTest" - + - name: Upload Code Coverage Report + uses: actions/upload-artifact@v2 + with: + name: coveragereport + path: ${{ github.workspace }}/Tests/coveragereport