Merge pull request #47 from fededim/fededim-patch-5 #8
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: "Main Build Process" | |
# Runs on main branch commits, | |
# every commit in a pull request, any published release. | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
release: | |
types: [published] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
name: "Build & Test" | |
# Permissions this GitHub Action needs for other things in GitHub | |
permissions: | |
pull-requests: write | |
runs-on: windows-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.x | |
dotnet-quality: 'ga' | |
- name: "Restore/Build/Test" | |
run: dotnet test --configuration Release --verbosity normal --logger trx --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/[email protected] | |
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: Html;Cobertura;MarkdownSummaryGithub;Badges # 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 XML | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: ${{ github.workspace }}/Cobertura.xml | |
retention-days: 5 | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
recreate: true | |
path: code-coverage-results.md | |
- name: Upload Test Result Files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: ${{ github.workspace }}/**/TestResults/**/* | |
retention-days: 5 | |