Skip to content

Bump Microsoft.AspNetCore.Components.WebAssembly.DevServer in /src (#… #155

Bump Microsoft.AspNetCore.Components.WebAssembly.DevServer in /src (#…

Bump Microsoft.AspNetCore.Components.WebAssembly.DevServer in /src (#… #155

Workflow file for this run

name: Build / Test (with Reports)
# Run workflow on every push to the master branch
on:
workflow_dispatch:
push:
branches: [ main, dev ]
paths: src/**
pull_request:
branches: [ main ]
paths: src/**
# permissions:
# contents: read
# issues: read
# checks: write
# pull-requests: write
# pages: write
# #id-token: write
jobs:
build-test:
# use ubuntu-latest image to run steps on
runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: src
steps:
# uses GitHub's checkout action to checkout code form the master branch
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: ⬇️ Restore dependencies
run: dotnet restore
working-directory: src
- name: 🔨 Build
run: dotnet build --no-restore
working-directory: src
# Run Tests
- name: Unit Testing
# run: dotnet test Utility.Test/Utility.Test.csproj
run: dotnet test Utility.Test/Utility.Test.csproj --collect:"XPlat Code Coverage"
working-directory: src
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
xunit_files: 'src/Utility.Test/TestResults/**/coverage.cobertura.xml'
# ReportGenerator -reports:"src/Utility.Test/TestResults/**/coverage.cobertura.xml" -targetdir:coveragereport
- name: ReportGenerator
uses: danielpalme/[email protected]
with:
reports: 'src/Utility.Test/TestResults/**/coverage.cobertura.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
targetdir: 'coveragereport' # REQUIRED # The directory where the generated report should be saved.
reporttypes: 'HtmlInline;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, Html_Dark, Html_Light, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
# sourcedirs: '' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
# historydir: '' # Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution.
# plugins: '' # Optional plugin files for custom reports or custom history storage (separated by semicolon).
assemblyfilters: '+Utility*;-XUnit.*;-Bunit.*;-AltCover.*;-AngleSharpWrappers' # Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.
classfilters: '+*;-Utility.Test' # Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.
filefilters: '+*' # Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed.
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
# title: '' # Optional title.
tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version.
# license: '' # Optional license for PRO version. Get your license here: https://reportgenerator.io/pro
# 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: Deploy Code Coverage Report
# uses: peaceiris/actions-gh-pages@v3
# # if: github.event_name == 'push'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: coveragereport
# destination_dir: coverage
# enable_jekyll: true
- name: Deploy Code Coverage Report
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: coveragereport
target-folder: coverage
- name: Upload coverage report artifact
uses: actions/[email protected]
with:
name: CoverageReport # Artifact name
path: coveragereport # Directory containing files to upload
# https://github.com/zyborg/dotnet-tests-report
# https://github.com/marketplace/actions/dotnet-tests-report
- name: use this action, test solution dir
uses: zyborg/dotnet-tests-report@v1
with:
project_path: src/Utility.Test
report_name: Tests
report_title: My Tests
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: utility_blazor_tests.md
gist_badge_label: 'Utility Blazor: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}