forked from FritzAndFriends/BlazorWebFormsComponents
-
Notifications
You must be signed in to change notification settings - Fork 3
109 lines (91 loc) · 3.79 KB
/
build.yml
File metadata and controls
109 lines (91 loc) · 3.79 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
109
name: Build and Test
on:
push:
branches:
- 'main'
- 'dev'
- 'v*'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'mkdocs.yml'
pull_request:
branches:
- 'main'
- 'dev'
- 'v*'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'mkdocs.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Restore dependencies
run: |
dotnet restore src/BlazorWebFormsComponents/BlazorWebFormsComponents.csproj
dotnet restore src/BlazorWebFormsComponents.Test/BlazorWebFormsComponents.Test.csproj
dotnet restore samples/AfterBlazorServerSide/AfterBlazorServerSide.csproj
dotnet restore src/BlazorWebFormsComponents.Analyzers.Test/BlazorWebFormsComponents.Analyzers.Test.csproj
dotnet restore scripts/GenerateHealthSnapshot/GenerateHealthSnapshot.csproj
- name: Build library
run: dotnet build src/BlazorWebFormsComponents/BlazorWebFormsComponents.csproj --configuration Release --no-restore
- name: Build test project
run: dotnet build src/BlazorWebFormsComponents.Test/BlazorWebFormsComponents.Test.csproj --configuration Release --no-restore
- name: Build analyzer tests
run: dotnet build src/BlazorWebFormsComponents.Analyzers.Test/BlazorWebFormsComponents.Analyzers.Test.csproj --configuration Release --no-restore
- name: Build server-side sample
run: dotnet build samples/AfterBlazorServerSide/AfterBlazorServerSide.csproj --configuration Release --no-restore
- name: Run tests
run: dotnet test src/BlazorWebFormsComponents.Test/BlazorWebFormsComponents.Test.csproj --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" --results-directory src/BlazorWebFormsComponents.Test/TestResults
- name: Run analyzer tests
run: dotnet test src/BlazorWebFormsComponents.Analyzers.Test/BlazorWebFormsComponents.Analyzers.Test.csproj --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=analyzer-test-results.trx" --results-directory src/BlazorWebFormsComponents.Analyzers.Test/TestResults
- name: Generate health snapshot
run: dotnet run --project scripts/GenerateHealthSnapshot/GenerateHealthSnapshot.csproj --configuration Release -- ${{ github.workspace }} ${{ github.workspace }}/health-snapshot.json
- name: Upload health snapshot
uses: actions/upload-artifact@v4
if: always()
with:
name: health-snapshot
path: health-snapshot.json
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: src/BlazorWebFormsComponents.Test/TestResults/*.trx
- name: Upload analyzer test results
uses: actions/upload-artifact@v4
if: always()
with:
name: analyzer-test-results
path: src/BlazorWebFormsComponents.Analyzers.Test/TestResults/*.trx
- name: Publish test results
uses: dorny/test-reporter@v2
if: always()
with:
name: Unit Test Results
path: src/BlazorWebFormsComponents.Test/TestResults/*.trx
reporter: dotnet-trx
fail-on-error: true
- name: Publish analyzer test results
uses: dorny/test-reporter@v2
if: always()
with:
name: Analyzer Test Results
path: src/BlazorWebFormsComponents.Analyzers.Test/TestResults/*.trx
reporter: dotnet-trx
fail-on-error: true