Skip to content

Commit 66e6246

Browse files
Merge pull request #571 from TransactionProcessing/task/#570-move-code-coverage-to-its-own-workflow
Task/#570 move code coverage to its own workflow
2 parents a1f88ce + 082baf0 commit 66e6246

2 files changed

Lines changed: 45 additions & 14 deletions

File tree

.github/workflows/codecoverage.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

.github/workflows/nightlybuild.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,6 @@ jobs:
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

0 commit comments

Comments
 (0)