Skip to content

⬆️ Update deps. #380

⬆️ Update deps.

⬆️ Update deps. #380

Workflow file for this run

name: "Run tests"
on:
push:
pull_request:
paths:
- "**.cs"
- "**.csproj"
permissions:
contents: read
# https://www.meziantou.net/how-to-cancel-github-workflows-when-pushing-new-commits-on-a-branch.htm
concurrency:
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: test-${{matrix.os}}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4.1.1
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: "8.x"
dotnet-quality: "ga"
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Install dependencies
env:
COMMIT_VAR: ${{ contains(github.actor, 'dependabot') }}
run: |
if ${COMMIT_VAR} == true; then
dotnet restore --force-evaluate
else
dotnet restore
fi
- name: Build
run: dotnet build --configuration Release --no-restore --tl
- name: Test
run: dotnet test -s .runsettings --no-restore --verbosity normal --logger GitHubActions
- name: Code coverage
uses: codecov/codecov-action@v4.0.1
with:
flags: unittests
verbose: true
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1
with:
reports: './**/TestResults/**/*.cobertura.xml'
targetdir: '${{ github.workspace }}/coveragereport'
reporttypes: 'MarkdownSummaryGithub'
# https://github.com/danielpalme/ReportGenerator/issues/431
- name: Publish coverage summary
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: coveragereport/SummaryGithub.md
- name: Upload coverage into summary
run: cat $GITHUB_WORKSPACE/coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ./**/TestResults/**/*.cobertura.xml