-
Notifications
You must be signed in to change notification settings - Fork 2
193 lines (170 loc) · 6.82 KB
/
Copy pathci.yml
File metadata and controls
193 lines (170 loc) · 6.82 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: CI
on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
jobs:
build:
name: Build, Test, Format
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Verify version consistency
shell: pwsh
run: ./build/verify-version.ps1
- name: Verify RequiresSdk CI legs
shell: pwsh
run: ./build/verify-ci-sdk.ps1
- name: Verify briefing drift guard
shell: pwsh
run: ./build/verify-briefing.ps1
- name: Validate MCP registry manifest
shell: pwsh
run: |
$desc = (Get-Content mcp-registry/server.json -Raw | ConvertFrom-Json).description
if ($desc.Length -gt 100) {
throw "mcp-registry/server.json description is $($desc.Length) chars; the registry caps it at 100."
}
Write-Host "MCP manifest description length $($desc.Length)/100 - OK."
- name: Restore
run: dotnet restore Fuse.slnx
- name: Check vulnerable packages (shipped)
shell: pwsh
run: |
# Keep in sync with NuGetAuditSuppress entries in Directory.Build.props.
$suppressedAdvisories = @(
'https://github.com/advisories/GHSA-hv8m-jj95-wg3x',
'https://github.com/advisories/GHSA-vh6j-jc39-fggf',
'https://github.com/advisories/GHSA-h4j7-5rxr-p4wc'
)
$failed = $false
Get-ChildItem -Path src -Recurse -Filter *.csproj | ForEach-Object {
$project = $_.FullName
Write-Host "Auditing $project"
$jsonText = dotnet list $project package --vulnerable --include-transitive --format json
if ($LASTEXITCODE -ne 0) {
Write-Error "dotnet list package failed for $project"
$failed = $true
return
}
$report = $jsonText | ConvertFrom-Json
foreach ($entry in $report.projects) {
foreach ($framework in $entry.frameworks) {
$packages = @()
if ($framework.topLevelPackages) { $packages += $framework.topLevelPackages }
if ($framework.transitivePackages) { $packages += $framework.transitivePackages }
foreach ($package in $packages) {
if (-not $package.vulnerabilities) { continue }
foreach ($advisory in $package.vulnerabilities) {
if ($suppressedAdvisories -contains $advisory.advisoryurl) { continue }
if ($advisory.severity -eq 'High' -or $advisory.severity -eq 'Critical') {
Write-Host "::error::$($package.id) $($package.resolvedVersion) [$($advisory.severity)] $($advisory.advisoryurl)"
$failed = $true
}
}
}
}
}
}
if ($failed) { exit 1 }
- name: Build
run: dotnet build Fuse.slnx --configuration Release --no-restore
- name: Install dotnet-coverage
run: dotnet tool install --global dotnet-coverage
- name: Test with coverage
run: dotnet-coverage collect 'dotnet test Fuse.slnx --configuration Release --no-build --verbosity normal --filter "Category!=RequiresSdk"' --output coverage.cobertura.xml --output-format cobertura
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.cobertura.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Format check
run: dotnet format Fuse.slnx --verify-no-changes
runtime:
name: Self-contained runtime (${{ matrix.rid }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# All six RIDs are published (the self-contained release binaries, one per platform). Each RID is built
# on its matching OS; the native-arch ones also smoke-test, while the cross-arch ones (built on the other
# arch of the same OS) only publish, since the runner cannot execute a different architecture.
include:
- os: windows-latest
rid: win-x64
profile: runtime-win-x64
binary: fuse.exe
smoke: true
- os: windows-latest
rid: win-arm64
profile: runtime-win-arm64
binary: fuse.exe
smoke: false
- os: ubuntu-latest
rid: linux-x64
profile: runtime-linux-x64
binary: fuse
smoke: true
- os: ubuntu-latest
rid: linux-arm64
profile: runtime-linux-arm64
binary: fuse
smoke: false
- os: macos-latest
rid: osx-arm64
profile: runtime-osx-arm64
binary: fuse
smoke: true
- os: macos-latest
rid: osx-x64
profile: runtime-osx-x64
binary: fuse
smoke: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install Linux publish prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang zlib1g-dev
- name: Restore
run: dotnet restore src/Host/Fuse.Cli/Fuse.Cli.csproj
- name: Publish self-contained
run: dotnet publish src/Host/Fuse.Cli/Fuse.Cli.csproj --configuration Release /p:PublishProfile=${{ matrix.profile }}
- name: Smoke test init help
if: matrix.smoke
shell: bash
run: |
BIN="artifacts/runtime/${{ matrix.rid }}/${{ matrix.binary }}"
"$BIN" init --help
- name: Smoke test SampleShop index and context
if: matrix.smoke
shell: bash
run: |
# Verify the self-contained binary can build the syntax index (FTS5 present in the bundled
# SQLite) and serve context, in an isolated Git repository and store.
BIN="artifacts/runtime/${{ matrix.rid }}/${{ matrix.binary }}"
WS="${RUNNER_TEMP:-/tmp}/fuse-runtime-smoke"
export FUSE_USER_DATA="${RUNNER_TEMP:-/tmp}/fuse-runtime-store"
rm -rf "$WS" "$FUSE_USER_DATA"
mkdir -p "$WS" "$FUSE_USER_DATA"
cp -r tests/fixtures/SampleShop/* "$WS/"
git init -q "$WS"
"$BIN" index "$WS"
# diagnostics must report the index built and FTS5 available, or the publish dropped FTS5.
"$BIN" diagnostics "$WS" | tee "$WS/.diag.txt"
grep -q "full-text search: available" "$WS/.diag.txt"
"$BIN" map "$WS" --detail all
"$BIN" review "$WS" --plan-only || true