Skip to content

Commit

Permalink
Fix: Locate code coverage file
Browse files Browse the repository at this point in the history
  • Loading branch information
george-chakhidze committed Nov 23, 2022
1 parent 15d5cd5 commit 1f23ff1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ jobs:
dotnet build -c Release --no-restore "-p:SourceRevisionId=$revisionId"
- name: Test
run: dotnet test -c Release --no-build --no-restore --verbosity normal '--collect:"XPlat Code Coverage"' --results-directory "$env:GITHUB_WORKSPACE/coverage/" --% -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.SkipAutoProps=true
run: |
dotnet test -c Release --no-build --no-restore --verbosity normal '--collect:"XPlat Code Coverage"' --results-directory "$env:GITHUB_WORKSPACE/coverage/" --% -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.SkipAutoProps=true
echo "CODE_COVERAGE_PATH=$($(dir "$env:GITHUB_WORKSPACE/coverage/" -Filter 'coverage.cobertura.xml' -Recurse | select -first 1).FullName)" >> $GITHUB_ENV
- uses: codecov/codecov-action@v3
with:
files: '${{ env.GITHUB_WORKSPACE }}/coverage/coverage.cobertura.xml'
files: ${{ env.CODE_COVERAGE_PATH }}
flags: unittests
fail_ci_if_error: true
verbose: false
6 changes: 4 additions & 2 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ jobs:
dotnet build -c Release --no-restore "-p:SourceRevisionId=$revisionId"
- name: Test
run: dotnet test -c Release --no-build --no-restore --verbosity normal '--collect:"XPlat Code Coverage"' --results-directory "$env:GITHUB_WORKSPACE/coverage/" --% -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.SkipAutoProps=true
run: |
dotnet test -c Release --no-build --no-restore --verbosity normal '--collect:"XPlat Code Coverage"' --results-directory "$env:GITHUB_WORKSPACE/coverage/" --% -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.SkipAutoProps=true
echo "CODE_COVERAGE_PATH=$($(dir "$env:GITHUB_WORKSPACE/coverage/" -Filter 'coverage.cobertura.xml' -Recurse | select -first 1).FullName)" >> $GITHUB_ENV
- uses: codecov/codecov-action@v3
with:
files: '${{ env.GITHUB_WORKSPACE }}/coverage/coverage.cobertura.xml'
files: ${{ env.CODE_COVERAGE_PATH }}
flags: unittests
fail_ci_if_error: true
verbose: true
Expand Down

0 comments on commit 1f23ff1

Please sign in to comment.