chore(deps): update actions/setup-dotnet action to v4 (#35) #161
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
- '**/renovate.json' | |
- '.github/workflows/release.yaml' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**/renovate.json' | |
- '.github/workflows/release.yaml' | |
jobs: | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_NOLOGO: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: NuGet Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: ${{ runner.os}}-nuget | |
- name: Install .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Build | |
run: dotnet build -c release | |
- name: Test | |
run: | | |
dotnet test -c release --no-restore --no-build \ | |
--logger:trx \ | |
--results-directory ${{ runner.temp }}/TestResults \ | |
-p:CollectCoverage=true \ | |
-p:CoverletOutputFormat=opencover \ | |
-p:CoverletOutput=${{ runner.temp }}/coverage.opencover.xml | |
- name: Publish Test Results | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() | |
with: | |
name: Test Results | |
path: ${{ runner.temp }}/TestResults/*.trx | |
reporter: dotnet-trx | |
- name: Codacy Coverage | |
if: always() | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_TOKEN }} | |
coverage-reports: ${{ runner.temp }}/coverage.opencover.xml | |