-
Notifications
You must be signed in to change notification settings - Fork 0
250 lines (210 loc) · 9.46 KB
/
Copy pathci.yml
File metadata and controls
250 lines (210 loc) · 9.46 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: CI — Validate Build + Test
on:
push:
branches: [main, feat/*, fix/*]
pull_request:
branches: [main]
jobs:
python-search-test:
name: Python Search Engine
runs-on: ubuntu-latest
defaults:
run:
working-directory: .claude/skills/generalupdate-troubleshoot
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install test dependencies
run: pip install pytest
- name: Run BM25 search tests
run: |
python3 -m pytest scripts/tests/ -v
- name: Smoke test — Chinese search
run: |
result=$(python3 scripts/search.py "升级后启动不了" --domain issue -n 1 --json)
matches=$(echo "$result" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['count'])")
echo "Search matches: $matches"
[ "$matches" -ge 1 ] && echo "✅ Search works" || (echo "❌ Search failed"; exit 1)
- name: Smoke test — English search
run: |
result=$(python3 scripts/search.py "method not found" --domain issue -n 1 --json)
matches=$(echo "$result" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['count'])")
echo "Search matches: $matches"
[ "$matches" -ge 1 ] && echo "✅ English search works" || (echo "❌ English search failed"; exit 1)
- name: Smoke test — Strategy search
run: |
result=$(python3 scripts/search.py "OSS no backend" --domain strategy -n 1 --json)
matches=$(echo "$result" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['count'])")
echo "Search matches: $matches"
[ "$matches" -ge 1 ] && echo "✅ Strategy search works" || (echo "❌ Strategy search failed"; exit 1)
python-codegen-test:
name: Python Code Generator
runs-on: ubuntu-latest
defaults:
run:
working-directory: .claude/scripts
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: List all combinations
run: |
count=$(python3 generate.py --list | grep -c "Total combinations")
echo "Combinations listed: $count"
python3 generate.py --list
- name: Generate — OSS + WPF + Bowl
run: |
python3 generate.py --strategy oss --framework wpf-layui --bowl \
--project-name TestApp --version 1.0.0.0 -o /tmp/gen-test-oss
echo "=== Files generated ==="
find /tmp/gen-test-oss -type f | sort
echo "=== Verify Bootstrap.cs contains expected values ==="
grep -q "TestApp.exe" /tmp/gen-test-oss/Client/Integration.cs && echo "✅ AppName correct"
grep -q "GeneralUpdate.Bowl.Bowl.MonitorParameter" /tmp/gen-test-oss/Client/Integration.cs && echo "✅ Bowl included"
grep -q "1.0.0.0" /tmp/gen-test-oss/generalupdate.manifest.json && echo "✅ Version correct"
- name: Generate — Silent + Console (no Bowl)
run: |
python3 generate.py --strategy silent --framework console \
--project-name MyService --version 2.0.0.0 \
--update-url https://api.example.com/check -o /tmp/gen-test-silent
echo "=== Files generated ==="
find /tmp/gen-test-silent -type f | sort
grep -q "MyService.exe" /tmp/gen-test-silent/Client/Integration.cs && echo "✅ AppName correct"
grep -q "Console.WriteLine" /tmp/gen-test-silent/Client/Integration.cs && echo "✅ Console listeners correct"
- name: Generate — Standard + Avalonia + Differential
run: |
python3 generate.py --strategy differential --framework avalonia-semiursa \
--project-name CrossApp --version 3.1.0.0 -o /tmp/gen-test-diff
echo "=== Files generated ==="
find /tmp/gen-test-diff -type f | sort
grep -q "CrossApp" /tmp/gen-test-diff/Client/Integration.cs && echo "✅ Correct"
grep -q "Differential" /tmp/gen-test-diff/IssuesWarning.md && echo "✅ Warnings included"
- name: Validate — All files are valid UTF-8 and non-empty
run: |
for f in $(find /tmp -name "*.cs" -o -name "*.json" -o -name "*.md" 2>/dev/null); do
[ -s "$f" ] || (echo "❌ Empty file: $f"; exit 1)
file "$f" | grep -q "UTF-8\|ASCII\|text" || (echo "❌ Non-text file: $f"; exit 1)
done
echo "✅ All generated files valid"
dotnet-verify-templates:
name: .NET — Template Build Verification
runs-on: windows-latest
strategy:
matrix:
template: [MinimalIntegration, FullIntegration]
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Generate test project from ${{ matrix.template }}
run: |
$templateName = "${{ matrix.template }}"
$templatePath = ".claude/skills/generalupdate-init/templates"
$testDir = "C:\tmp\verify-$templateName"
New-Item -ItemType Directory -Path $testDir -Force | Out-Null
# Create minimal .csproj
@"
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GeneralUpdate.Core" Version="10.5.0-beta.6" />
</ItemGroup>
</Project>
"@ | Out-File -FilePath "$testDir\TestProject.csproj" -Encoding UTF8
# Copy template and r-w AssemblyName to config
$code = Get-Content "$templatePath\$templateName.cs" -Raw
$code = $code -replace 'MyApp\.exe', 'TestApp.exe'
$code = $code -replace '1\.0\.0\.0', '1.0.0.1'
$code = $code -replace 'my-product-001', 'test-001'
# Insert top-level entry point after using directives (C# requires
# top-level statements before type declarations, but after usings)
$nl = [Environment]::NewLine
$entryPoint = "// Entry point for build verification$nl" +
"Console.WriteLine(""Verifying $templateName compiles..."");$nl" +
"await $templateName.RunAsync();$nl"
# Insert before the first /// documentation comment only (single match)
$pos = $code.IndexOf('/// <summary>')
if ($pos -ge 0) { $code = $code.Insert($pos, "$entryPoint$nl") }
$code | Out-File -FilePath "$testDir\Program.cs" -Encoding UTF8
Write-Host "=== Verifying: $templateName ==="
dotnet build "$testDir\TestProject.csproj" 2>&1
if ($LASTEXITCODE -ne 0) { throw "Build failed for $templateName" }
Write-Host "✅ $templateName compiles successfully"
- name: Verify build success
run: |
echo "✅ ${{ matrix.template }} build was already verified in the previous step"
dotnet-verify-scaffold:
name: .NET — Complete Scaffold Build
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Build scaffold projects
run: |
$scaffoldDir = ".claude/skills/generalupdate-init/project-scaffold"
$rootDir = "C:\tmp\verify-scaffold"
# Use separate subdirectories so each project only sees its own .cs files
$clientDir = "$rootDir\Client"
$upgradeDir = "$rootDir\Upgrade"
New-Item -ItemType Directory -Path $clientDir -Force | Out-Null
New-Item -ItemType Directory -Path $upgradeDir -Force | Out-Null
Copy-Item "$scaffoldDir\ClientApp.csproj" "$clientDir\ClientApp.csproj"
Copy-Item "$scaffoldDir\UpgradeApp.csproj" "$upgradeDir\UpgradeApp.csproj"
Copy-Item "$scaffoldDir\ClientProgram.cs" "$clientDir\Program.cs"
Copy-Item "$scaffoldDir\UpgradeProgram.cs" "$upgradeDir\Program.cs"
# Build Client
dotnet build "$clientDir\ClientApp.csproj" 2>&1
if ($LASTEXITCODE -ne 0) { throw "ClientApp build failed" }
echo "✅ ClientApp compiles"
# Build Upgrade
dotnet build "$upgradeDir\UpgradeApp.csproj" 2>&1
if ($LASTEXITCODE -ne 0) { throw "UpgradeApp build failed" }
echo "✅ UpgradeApp compiles"
cli-verify-typescript:
name: CLI — TypeScript Compilation
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: cli/package-lock.json
- name: Install dependencies
run: npm ci --ignore-scripts
- name: TypeScript compile
run: npx tsc --noEmit
- name: Ensure entry point structure is valid
run: |
grep -q "commander" src/index.ts && echo "✅ Commander found"
grep -q "initCommand" src/index.ts && echo "✅ initCommand referenced"