Use coverlet.MTP to enable test coverage collection +semver: skip #70
This file contains hidden or 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: .NET | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install GitVersion | |
| run: dotnet tool install -g GitVersion.Tool --version 5.* | |
| - name: Execute GitVersion | |
| id: version | |
| run: dotnet-gitversion /output buildserver | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5.2.0 | |
| with: | |
| dotnet-version: 10.0.x | |
| global-json-file: './global.json' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build -c Release --no-restore | |
| - name: Pack | |
| run: dotnet pack -c Release --no-build /p:PackageVersion=${{ env.GitVersion_SemVer }} | |
| - name: Test | |
| run: dotnet test -c Release --no-build --verbosity normal --report-github --coverlet --coverlet-output-format opencover | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5.5.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Push | |
| if: ${{ github.event_name == 'push' && github.ref_name == 'master' }} | |
| run: dotnet nuget push "**/*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGET_AUTH_TOKEN | |
| env: | |
| NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} |