chore(deps): update codecov/codecov-action action to v5 #118
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: .NET Coverage (Ubuntu) | |
on: | |
push: | |
# branches: | |
# branches-ignore: | |
pull_request: | |
# branches: | |
# branches-ignore: | |
env: | |
# Disable the .NET logo in the console output. | |
DOTNET_NOLOGO: true | |
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build. | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
# Disable sending .NET CLI telemetry to Microsoft. | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
BUILD_ARTIFACT_PATH: ${{github.workspace}}/build-artifacts | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Configure MongoDB (Ubuntu) | |
run: sudo systemctl start mongod | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# If you want to specify a particular version, use this. Otherwise, will use the Runner's installed version | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
# These two options cannot be combined because the logger causes duplicate coverage reports to go to CodeCov | |
# https://github.com/coverlet-coverage/coverlet/issues/733 | |
# if you want the test results, best to run separately | |
# - name: Test | |
# run: dotnet test --logger trx --results-directory ${{env.BUILD_ARTIFACT_PATH}}/test-results | |
- name: Test with coverage | |
run: dotnet test --results-directory ${{env.BUILD_ARTIFACT_PATH}}/coverage --collect "XPlat Code Coverage" --settings CodeCoverage.runsettings | |
- name: Upload coverage report | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
directory: ${{env.BUILD_ARTIFACT_PATH}}/coverage/ | |
path_to_write_report: ${{env.BUILD_ARTIFACT_PATH}}/coverage/codecov_report | |
fail_ci_if_error: false | |
- name: Publish artifacts | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
path: ${{env.BUILD_ARTIFACT_PATH}} |