Skip to content

push minor tweak

push minor tweak #126

Workflow file for this run

name: Code Coverage
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
workflow_dispatch:
jobs:
build:
name: "Code Coverage"
env:
ASPNETCORE_ENVIRONMENT: "Production"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Restore Nuget Packages
run: dotnet restore TransactionProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
- name: Build Code
run: dotnet build TransactionProcessor.sln --configuration Release
- name: Install Coverlet console
run: |
dotnet tool install --global coverlet.console --version 6.0.4
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
- name: Install LCOV merger
run: npm install -g lcov-result-merger
- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
mkdir -p coverage
coverlet TransactionProcessor.BusinessLogic.Tests/bin/Release/net10.0/TransactionProcessor.BusinessLogic.Tests.dll --target dotnet --targetargs "TransactionProcessor.BusinessLogic.Tests/bin/Release/net10.0/TransactionProcessor.BusinessLogic.Tests.dll" --format lcov --output coverage/lcov1.info --exclude "[xunit*]*" --exclude-by-attribute Obsolete --exclude-by-attribute GeneratedCodeAttribute --exclude-by-attribute CompilerGeneratedAttribute --exclude-by-attribute ExcludeFromCodeCoverageAttribute
coverlet TransactionProcessor.ProjectionEngine.Tests/bin/Release/net10.0/TransactionProcessor.ProjectionEngine.Tests.dll --target dotnet --targetargs "TransactionProcessor.ProjectionEngine.Tests/bin/Release/net10.0/TransactionProcessor.ProjectionEngine.Tests.dll" --format lcov --output coverage/lcov2.info --exclude "[xunit*]*" --exclude-by-attribute Obsolete --exclude-by-attribute GeneratedCodeAttribute --exclude-by-attribute CompilerGeneratedAttribute --exclude-by-attribute ExcludeFromCodeCoverageAttribute
coverlet TransactionProcessor.Aggregates.Tests/bin/Release/net10.0/TransactionProcessor.Aggregates.Tests.dll --target dotnet --targetargs "TransactionProcessor.Aggregates.Tests/bin/Release/net10.0/TransactionProcessor.Aggregates.Tests.dll" --format lcov --output coverage/lcov3.info --exclude "[xunit*]*" --exclude-by-attribute Obsolete --exclude-by-attribute GeneratedCodeAttribute --exclude-by-attribute CompilerGeneratedAttribute --exclude-by-attribute ExcludeFromCodeCoverageAttribute
coverlet TransactionProcessor.Tests/bin/Release/net10.0/TransactionProcessor.Tests.dll --target dotnet --targetargs "TransactionProcessor.Tests/bin/Release/net10.0/TransactionProcessor.Tests.dll" --format lcov --output coverage/lcov4.info --exclude "[xunit*]*" --exclude-by-attribute Obsolete --exclude-by-attribute GeneratedCodeAttribute --exclude-by-attribute CompilerGeneratedAttribute --exclude-by-attribute ExcludeFromCodeCoverageAttribute
coverlet TransactionProcessor.DatabaseTests/bin/Release/net10.0/TransactionProcessor.DatabaseTests.dll --target dotnet --targetargs "TransactionProcessor.DatabaseTests/bin/Release/net10.0/TransactionProcessor.DatabaseTests.dll" --format lcov --output coverage/lcov5.info --exclude "[xunit*]*" --exclude-by-attribute Obsolete --exclude-by-attribute GeneratedCodeAttribute --exclude-by-attribute CompilerGeneratedAttribute --exclude-by-attribute ExcludeFromCodeCoverageAttribute
- name: Merge LCOV reports
run: |
lcov-result-merger "coverage/*.info" > lcov.info
- name: Upload merged coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./lcov.info