File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Code Coverage
2+
3+ on :
4+ push :
5+ # branches to consider in the event; optional, defaults to all
6+ branches :
7+ - master
8+ workflow_dispatch :
9+
10+ jobs :
11+ build :
12+ name : " Code Coverage"
13+ env :
14+ ASPNETCORE_ENVIRONMENT : " Production"
15+
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - uses : actions/checkout@v2.3.4
20+
21+ - name : Restore Nuget Packages
22+ run : dotnet restore TransactionProcessorACL.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
23+
24+ - name : Build Code
25+ run : dotnet build TransactionProcessorACL.sln --configuration Release
26+
27+ - name : Run Unit Tests
28+ run : |
29+ echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
30+ dotnet test "TransactionProcessorACL.Tests\TransactionProcessorACL.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
31+ dotnet test "TransactionProcessorACL.BusinessLogic.Tests\TransactionProcessorACL.BusinessLogic.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
32+
33+ - name : Install LCOV merger
34+ run : npm install -g lcov-result-merger
35+
36+ - name : Merge LCOV reports
37+ run : |
38+ mkdir -p coverage
39+ lcov-result-merger "*.info" > lcov.info
40+
41+ - name : Upload merged coverage to Codacy
42+ uses : codacy/codacy-coverage-reporter-action@v1
43+ with :
44+ project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
45+ coverage-reports : ./lcov.info
Original file line number Diff line number Diff line change 3939 echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
4040 dotnet test "TransactionProcessorACL.Tests\TransactionProcessorACL.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov1.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
4141 dotnet test "TransactionProcessorACL.BusinessLogic.Tests\TransactionProcessorACL.BusinessLogic.Tests.csproj" /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:ExcludeByAttribute="Obsolete" /p:ExcludeByAttribute="GeneratedCodeAttribute" /p:ExcludeByAttribute="CompilerGeneratedAttribute" /p:ExcludeByAttribute="ExcludeFromCodeCoverageAttribute" /p:CoverletOutput="../lcov2.info" /maxcpucount:1 /p:CoverletOutputFormat="lcov"
42-
43- - name : Install LCOV merger
44- run : npm install -g lcov-result-merger
45-
46- - name : Merge LCOV reports
47- run : |
48- mkdir -p coverage
49- lcov-result-merger "*.info" > lcov.info
50-
51- - name : Upload merged coverage to Codacy
52- uses : codacy/codacy-coverage-reporter-action@v1
53- with :
54- project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
55- coverage-reports : ./lcov.info
5642
5743 - name : Build Docker Image
5844 run : docker build . --file TransactionProcessorACL/Dockerfile --tag transactionprocessoracl:latest
You can’t perform that action at this time.
0 commit comments