Update dotnetcore.yml #103
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 Core | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Build with dotnet | |
| run: dotnet build src/MockQueryable/*.sln --configuration Release | |
| - name: Test with coverage (coverlet) | |
| run: | | |
| mkdir -p TestResults | |
| COVERAGE_DIR="$(pwd)/TestResults" | |
| dotnet test src/MockQueryable/*.sln \ | |
| --configuration Release \ | |
| --no-build \ | |
| /p:CollectCoverage=true \ | |
| /p:CoverletOutput="$COVERAGE_DIR/coverage-" \ | |
| /p:CoverletOutputFormat=opencover | |
| ls -R "$COVERAGE_DIR" || echo Empty folder | |
| - name: Upload coverage results (artifact) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage | |
| path: TestResults | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: TestResults/**/*.opencover.xml | |
| flags: unittests | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} |