From 3490cec723923798bff18ae19c5fb9fce7f6ac8e Mon Sep 17 00:00:00 2001 From: MSPoulaei Date: Mon, 25 Dec 2023 09:32:05 +0330 Subject: [PATCH] test ci coverage --- .github/workflows/cicd.yaml | 30 +++++++++---------- .../Extensions/ServiceCollectionExtensions.cs | 0 .../VakilPors.Test/coverlet.runsettings | 24 +++++++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) rename src/VakilPors/VakilPors.Core/{Services => Contracts}/Extensions/ServiceCollectionExtensions.cs (100%) create mode 100644 src/VakilPors/VakilPors.Test/coverlet.runsettings diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 62ab5ca..795420f 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -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 @@ -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 \ No newline at end of file +# 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 \ No newline at end of file diff --git a/src/VakilPors/VakilPors.Core/Services/Extensions/ServiceCollectionExtensions.cs b/src/VakilPors/VakilPors.Core/Contracts/Extensions/ServiceCollectionExtensions.cs similarity index 100% rename from src/VakilPors/VakilPors.Core/Services/Extensions/ServiceCollectionExtensions.cs rename to src/VakilPors/VakilPors.Core/Contracts/Extensions/ServiceCollectionExtensions.cs diff --git a/src/VakilPors/VakilPors.Test/coverlet.runsettings b/src/VakilPors/VakilPors.Test/coverlet.runsettings new file mode 100644 index 0000000..ed657a3 --- /dev/null +++ b/src/VakilPors/VakilPors.Test/coverlet.runsettings @@ -0,0 +1,24 @@ + + + + + + + true + TestResults/ + opencover + + Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute + **/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 + **/VakilPors.Web/Controllers/*.cs,**/VakilPors.Core/Services/*.cs + + + true + true + + MissingAll,MissingAny,None + + + + + \ No newline at end of file