Skip to content

build(deps): Bump actions/setup-dotnet from 5.0.0 to 5.0.1 #149

build(deps): Bump actions/setup-dotnet from 5.0.0 to 5.0.1

build(deps): Bump actions/setup-dotnet from 5.0.0 to 5.0.1 #149

Workflow file for this run

name: 'Tests'
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, edited, synchronize]
branches:
- main
env:
COVERAGE_REPORT_DIRECTORY: 'CodeCoverageReports'
# Set up the .NET environment to improve test performance and reliability
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable .NET CLI telemetry
DOTNET_NOLOGO: true # Disable .NET CLI logo
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true # Enable ANSI color redirection
TERM: xterm # Enable ANSI color redirection
NUGET_XMLDOC_MODE: skip # Disable NuGet XML documentation generation
jobs:
test-project:
name: "Test project"
runs-on: ubuntu-22.04
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- name: "Checkout"
uses: actions/[email protected]
- name: "Setup .NET"
uses: actions/[email protected]
with:
global-json-file: 'global.json'
- name: "Restore dependencies"
run: dotnet restore
- name: "Build"
run: dotnet build --configuration Release --no-restore
- name: "Run tests"
run: dotnet test --configuration Release --no-build --verbosity normal --results-directory ${{ github.workspace }}/${{ env.COVERAGE_REPORT_DIRECTORY }} --collect:"XPlat Code Coverage"
- name: "Combine Coverage Reports" # This is because one report is produced per project, and we want one result for all of them.
uses: danielpalme/ReportGenerator-GitHub-Action@dcdfb6e704e87df6b2ed0cf123a6c9f69e364869
with:
reports: "**/*.cobertura.xml" # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
targetdir: "${{ github.workspace }}" # REQUIRED # The directory where the generated report should be saved.
reporttypes: "Cobertura" # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, Html_Dark, Html_Light, Html_BlueRed, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MarkdownSummaryGithub, MarkdownDeltaSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, TextDeltaSummary, Xml, XmlSummary
verbosity: "Info" # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
title: "Code Coverage" # Optional title.
tag: "${{ github.run_number }}_${{ github.run_id }}" # Optional tag or build version.
customSettings: "" # Optional custom settings (separated by semicolon). See: https://github.com/danielpalme/ReportGenerator/wiki/Settings.
toolpath: "reportgeneratortool" # Default directory for installing the dotnet tool.
- name: "Upload Combined Coverage"
uses: actions/[email protected]
with:
name: 'Coverage'
path: ${{ github.workspace }}/Cobertura.xml
if-no-files-found: error
- name: "Publish code coverage report"
uses: irongut/[email protected]
with:
filename: "Cobertura.xml"
badge: true
fail_below_min: false # just informative for now
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: "10 30"
- name: "Add Coverage in PR Comment"
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405
if: github.event_name == 'pull_request'
with:
header: coverage-report
hide_and_recreate: true
hide_classify: "OUTDATED"
path: code-coverage-results.md
- name: "Upload Test Results"
uses: actions/[email protected]
with:
name: 'TestResults'
path: ${{ github.workspace }}/${{ env.COVERAGE_REPORT_DIRECTORY }}/**/*
if-no-files-found: error
- name: "Publish Test Results"
uses: dorny/test-reporter@v2
if: always()
with:
name: "Test Results"
path: "${{ github.workspace }}/${{ env.COVERAGE_REPORT_DIRECTORY }}/**/*.trx"
reporter: dotnet-trx
- name: "Publish Test Summary"
uses: EnricoMi/[email protected]
if: always()
with:
check_name: "Test Summary"
files: "${{ github.workspace }}/${{ env.COVERAGE_REPORT_DIRECTORY }}/**/*.trx"