-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (78 loc) · 3.14 KB
/
Copy pathci.yml
File metadata and controls
101 lines (78 loc) · 3.14 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
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
env:
DOTNET_VERSION: '10.0.x'
permissions:
contents: read
jobs:
build-test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore local tools
run: dotnet tool restore
- name: Restore
run: dotnet restore ManagedCode.MCPGateway.slnx
- name: Build
run: dotnet build ManagedCode.MCPGateway.slnx --configuration Release --no-restore
- name: Analyze
run: dotnet build ManagedCode.MCPGateway.slnx --configuration Release --no-restore -p:RunAnalyzers=true
- name: Verify formatting
run: dotnet format ManagedCode.MCPGateway.slnx --verify-no-changes
- name: Roslynator
run: dotnet tool run roslynator analyze src/ManagedCode.MCPGateway/ManagedCode.MCPGateway.csproj tests/ManagedCode.MCPGateway.Tests/ManagedCode.MCPGateway.Tests.csproj
- name: Test
run: dotnet test --solution ManagedCode.MCPGateway.slnx --configuration Release --no-build --verbosity normal --report-trx --results-directory ./artifacts/test-results
- name: Collect coverage
run: dotnet tool run coverlet tests/ManagedCode.MCPGateway.Tests/bin/Release/net10.0/ManagedCode.MCPGateway.Tests.dll --target "./tests/ManagedCode.MCPGateway.Tests/bin/Release/net10.0/ManagedCode.MCPGateway.Tests" --targetargs "" --format cobertura --output artifacts/coverage/coverage.cobertura.xml
- name: Render coverage report
run: dotnet tool run reportgenerator -reports:"artifacts/coverage/coverage.cobertura.xml" -targetdir:"artifacts/coverage-report" -reporttypes:"HtmlSummary;MarkdownSummaryGithub"
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: ./artifacts/test-results/**
retention-days: 5
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
./artifacts/coverage/**
./artifacts/coverage-report/**
retention-days: 5
benchmarks:
name: Full Benchmarks
runs-on: ubuntu-latest
needs: build-test
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore
run: dotnet restore ManagedCode.MCPGateway.slnx
- name: Run full BenchmarkDotNet suite
run: dotnet run -c Release --project benchmarks/ManagedCode.MCPGateway.Benchmarks/ManagedCode.MCPGateway.Benchmarks.csproj -- --filter "*" --artifacts ./artifacts/benchmarks
- name: Upload benchmark artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: ./artifacts/benchmarks/**
retention-days: 14