merge coverage reports #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test Action | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: dotnet restore | |
run: | | |
dotnet tool restore | |
dotnet restore | |
- name: Build | |
run: | | |
dotnet build --no-restore --configuration Release | |
- name: Run tests | |
run: | | |
dotnet test --no-build --configuration Release --settings=all_tests.runsettings --collect:"XPlat Code Coverage" --logger "trx;LogFileName=TestResults.xml" | |
dotnet coverage merge ./**/TestResults/**/coverage.cobertura.xml -f cobertura -o ./coverage.cobertura.xml | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
./**/TestResults.xml | |
- name: Upload test coverage report | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
format: cobertura | |
files: | | |
coverage.cobertura.xml | |