-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (94 loc) · 5.17 KB
/
Copy pathbuild-test.yml
File metadata and controls
108 lines (94 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: 🔨 Build / 🧪 Test (with 📊 Reports)
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:
- name: 🛎️ Checkout
uses: actions/checkout@v7
- name: ⚙️ Setup .NET 10.0
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
# include-prerelease: true
- name: ⬇️ Restore dependencies
run: dotnet restore
working-directory: src
- name: 🔨 Build
run: dotnet build --no-restore
working-directory: src
- name: 🧪 Unit Testing
# run: dotnet test Blashing.Core.Tests.csproj --collect:"XPlat Code Coverage"
run: dotnet test --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/**/TestResults/**/coverage.cobertura.xml'
# ReportGenerator -reports:"src/**/TestResults/**/coverage.cobertura.xml" -targetdir:coveragereport
- name: 📊 ReportGenerator
uses: danielpalme/[email protected]
with:
reports: 'src/**/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: '+Blashing*;-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: '+*;-Blashing.Core.Tests' # 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: ⬆️ 📊 Upload coverage report artifact
uses: actions/upload-artifact@v7
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: 🧪 Unit Tests - Blashing Core
uses: zyborg/dotnet-tests-report@v1
with:
project_path: src/Blashing.Core.Tests
report_name: Blashing Core Tests
report_title: Blashing Core Tests
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: blashing_core_tests.md
gist_badge_label: 'Blashing Core: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}
# https://github.com/zyborg/dotnet-tests-report
# https://github.com/marketplace/actions/dotnet-tests-report
- name: 🧪 Unit Tests - Blashing Widgets
uses: zyborg/dotnet-tests-report@v1
with:
project_path: src/Blashing.Widgets.Tests
report_name: Blashing Widgets Tests
report_title: Blashing Widgets Tests
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: blashing_widgets_tests.md
gist_badge_label: 'Blashing Widgets: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}