Update README.md #7
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: Tests and Coverage | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDKs | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore ancpdevkit.sln | |
| - name: Build | |
| run: dotnet build ancpdevkit.sln --no-restore --configuration Release | |
| - name: Install dotnet-coverage | |
| run: dotnet tool install --global dotnet-coverage | |
| - name: Run tests with coverage | |
| run: | | |
| ~/.dotnet/tools/dotnet-coverage collect "dotnet test ancpdevkit.sln --no-build --configuration Release --logger:\"trx;LogFileName=test_results.trx\"" \ | |
| -f cobertura -o "coverage.cobertura.xml" | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.cobertura.xml | |
| fail_ci_if_error: false |