Skip to content

Commit

Permalink
test ci coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MSPoulaei committed Dec 25, 2023
1 parent 5080000 commit 3490cec
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: dotnet build --no-restore
working-directory: ./src/VakilPors
- name: Test
run: dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover --no-build --verbosity normal VakilPors.Test/
run: dotnet test --collect:"XPlat Code Coverage" --settings VakilPors.Test/coverlet.runsettings --verbosity normal --no-build
working-directory: ./src/VakilPors
- name: Create Test Coverage Badge
uses: simon-k/dotnet-code-coverage-badge@v1.0.0
Expand All @@ -37,17 +37,17 @@ jobs:
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
- name: Print code coverage
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"
cd:
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: update-liara
env:
LIARA_TOKEN: ${{ secrets.LIARA_API_TOKEN }}
run: |
npm i -g @liara/cli@5
liara deploy --api-token="$LIARA_TOKEN" --detach
# cd:
# needs: ci
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: "18"
# - name: update-liara
# env:
# LIARA_TOKEN: ${{ secrets.LIARA_API_TOKEN }}
# run: |
# npm i -g @liara/cli@5
# liara deploy --api-token="$LIARA_TOKEN" --detach
24 changes: 24 additions & 0 deletions src/VakilPors/VakilPors.Test/coverlet.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<CollectCoverage>true</CollectCoverage>
<CollectOutput>TestResults/</CollectOutput>
<Format>opencover</Format>
<!-- <Format>json,cobertura,lcov,teamcity,opencover</Format>-->
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
<ExcludeByFile>**/VakilPors.Data/**/*.cs,**/VakilPors.Shared/**/*.cs,**/VakilPors.Web/Configuration/**/*.cs,**/VakilPors.Web/Program.cs,**/VakilPors.Core/Authentication/**/*.cs,**/VakilPors.Core/Contracts/**/*.cs,**/VakilPors.Core/Domain/**/*.cs,**/VakilPors.Core/Exceptions/**/*.cs,**/VakilPors.Core/Hubs/**/*.cs,**/VakilPors.Core/Mapper/**/*.cs</ExcludeByFile> <!-- Globbing filter -->
<IncludeByFile>**/VakilPors.Web/Controllers/*.cs,**/VakilPors.Core/Services/*.cs</IncludeByFile>
<!-- <SingleHit>false</SingleHit>-->
<!-- <UseSourceLink>true</UseSourceLink>-->
<IncludeTestAssembly>true</IncludeTestAssembly>
<SkipAutoProps>true</SkipAutoProps>
<!-- <DeterministicReport>false</DeterministicReport>-->
<ExcludeAssembliesWithoutSources>MissingAll,MissingAny,None</ExcludeAssembliesWithoutSources>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>

0 comments on commit 3490cec

Please # to comment.