1818 with :
1919 fetch-depth : 0
2020 - name : Run tests
21- run : dotnet test --verbosity normal
21+ run : dotnet test --verbosity normal --collect:"XPlat Code Coverage"
22+ - name : Upload coverage
23+ uses : actions/upload-artifact@v2
24+ with :
25+ name : Code coverage ${{ matrix.os }}
26+ path : " **/coverage.cobertura.xml"
27+ coverage :
28+ name : Coverage
29+ needs : [test]
30+ runs-on : ubuntu-latest
31+ steps :
32+ - name : Checkout sources
33+ uses : actions/checkout@v2
34+ - uses : actions/download-artifact@v2
35+ with :
36+ name : Code coverage ubuntu-latest
37+ path : coverage-ubuntu
38+ - uses : actions/download-artifact@v2
39+ with :
40+ name : Code coverage windows-latest
41+ path : coverage-windows
42+ - uses : actions/download-artifact@v2
43+ with :
44+ name : Code coverage macos-latest
45+ path : coverage-macos
46+ - name : Generate coverage report
47+ uses : danielpalme/ReportGenerator-GitHub-Action@4.7.1
48+ with :
49+ reports : " **/coverage.cobertura.xml"
50+ targetdir : " coverage-report"
51+ reporttypes : " Cobertura"
52+ - name : Publish coverage report to Codacy
53+ uses : codacy/codacy-coverage-reporter-action@master
54+ with :
55+ project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
56+ coverage-reports : coverage-report/Cobertura.xml
2257 pack :
2358 name : Pack
2459 needs : [test]
2863 uses : actions/checkout@v2
2964 with :
3065 fetch-depth : 0
31- - name : Install .NET Core 3.1 SDK
32- uses : actions/setup-dotnet@v1
33- with :
34- dotnet-version : " 3.1.x"
3566 - name : Create packages
3667 run : dotnet pack --configuration Release --output ./packages
3768 - name : Upload a Build Artifact
@@ -53,14 +84,14 @@ jobs:
5384 with :
5485 name : NuGet packages
5586 path : packages
56- - name : Push packages
87+ - name : Push packages
5788 run : dotnet nuget push "packages/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
5889 - uses : dotnet/nbgv@v0.3.1
5990 id : nbgv
6091 - name : Create GitHub release
6192 uses : actions/create-release@v1
6293 env :
6394 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64- with :
95+ with :
6596 tag_name : v${{ steps.nbgv.outputs.SemVer2 }}
6697 release_name : v${{ steps.nbgv.outputs.SemVer2 }}
0 commit comments