-
-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (146 loc) · 9.1 KB
/
build.yml
File metadata and controls
182 lines (146 loc) · 9.1 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
name: Build
on:
push:
branches: [main]
paths:
- 'src/**'
- 'samples/**'
- 'tests/**'
- '.github/workflows/build.yml'
pull_request:
branches: [main]
paths:
- 'src/**'
- 'samples/**'
- 'tests/**'
- '.github/workflows/build.yml'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Create artifacts directory
run: New-Item -ItemType Directory -Force -Path artifacts/packages
- name: Build SDK
run: dotnet build src/CodingWithCalvin.VsixSdk/CodingWithCalvin.VsixSdk.csproj -c Release
- name: Build Templates
run: dotnet pack src/CodingWithCalvin.VsixSdk.Templates/CodingWithCalvin.VsixSdk.Templates.csproj -c Release
- name: Build Sample Extension
run: dotnet build samples/SampleExtension/SampleExtension.csproj -c Release
# E2E Tests - Build all test projects
- name: Build E2E.Minimal
run: dotnet build tests/e2e/E2E.Minimal/E2E.Minimal.csproj -c Release
- name: Build E2E.AutoIncludes
run: dotnet build tests/e2e/E2E.AutoIncludes/E2E.AutoIncludes.csproj -c Release
- name: Build E2E.SourceGenerators
run: dotnet build tests/e2e/E2E.SourceGenerators/E2E.SourceGenerators.csproj -c Release
- name: Build E2E.VersionOverride
run: dotnet build tests/e2e/E2E.VersionOverride/E2E.VersionOverride.csproj -c Release
- name: Build E2E.VersionOverride with SetVsixVersion
run: dotnet build tests/e2e/E2E.VersionOverride/E2E.VersionOverride.csproj -c Release -p:SetVsixVersion=2.0.0
- name: Build E2E.CustomPkgDef
run: dotnet build tests/e2e/E2E.CustomPkgDef/E2E.CustomPkgDef.csproj -c Release
- name: Build E2E.ManualPkgDef
run: dotnet build tests/e2e/E2E.ManualPkgDef/E2E.ManualPkgDef.csproj -c Release
- name: Build E2E.ImageAndContentManifest
run: dotnet build tests/e2e/E2E.ImageAndContentManifest/E2E.ImageAndContentManifest.csproj -c Release
- name: Build E2E.Validation (expect warnings)
run: dotnet build tests/e2e/E2E.Validation/E2E.Validation.csproj -c Release
- name: Build E2E.ValidationNoManifest (expect warnings)
run: dotnet build tests/e2e/E2E.ValidationNoManifest/E2E.ValidationNoManifest.csproj -c Release
- name: Build E2E.Templates.AutoDiscovery
run: dotnet build tests/e2e/E2E.Templates.AutoDiscovery/E2E.Templates.AutoDiscovery.csproj -c Release
- name: Build E2E.Templates.Reference
run: dotnet build tests/e2e/E2E.Templates.Reference/E2E.Templates.Reference.csproj -c Release
- name: Build E2E.Templates.ReferenceManual
run: dotnet build tests/e2e/E2E.Templates.ReferenceManual/E2E.Templates.ReferenceManual.csproj -c Release
- name: Build E2E.Templates.ManualWithSubPath
run: dotnet build tests/e2e/E2E.Templates.ManualWithSubPath/E2E.Templates.ManualWithSubPath.csproj -c Release
- name: Build E2E.AllFeatures
run: dotnet build tests/e2e/E2E.AllFeatures/E2E.AllFeatures.csproj -c Release
- name: Build E2E.Templates.AutoInject
run: dotnet build tests/e2e/E2E.Templates.AutoInject/E2E.Templates.AutoInject.csproj -c Release
# VSIX Verification - Check that VSIX files contain expected content
- name: Verify E2E.Minimal VSIX
run: |
$vsix = "tests/e2e/E2E.Minimal/bin/Release/net472/E2E.Minimal.vsix"
if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" }
Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Minimal/vsix-contents" -Force
$files = Get-ChildItem -Path "tests/e2e/E2E.Minimal/vsix-contents" -Recurse -File | Select-Object -ExpandProperty Name
if ($files -notcontains "extension.vsixmanifest") { throw "Missing extension.vsixmanifest" }
if ($files -notcontains "E2E.Minimal.dll") { throw "Missing E2E.Minimal.dll" }
Write-Host "E2E.Minimal VSIX verified successfully"
- name: Verify E2E.Templates.AutoDiscovery VSIX
run: |
$vsix = "tests/e2e/E2E.Templates.AutoDiscovery/bin/Release/net472/E2E.Templates.AutoDiscovery.vsix"
if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" }
Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.AutoDiscovery/vsix-contents" -Force
$files = Get-ChildItem -Path "tests/e2e/E2E.Templates.AutoDiscovery/vsix-contents" -Recurse | Select-Object -ExpandProperty Name
# VSSDK default behavior includes templates as folders with .vstemplate files
if ($files -notcontains "ConsoleApp.vstemplate") { throw "Missing ProjectTemplates/ConsoleApp/ConsoleApp.vstemplate" }
if ($files -notcontains "NewClass.vstemplate") { throw "Missing ItemTemplates/NewClass/NewClass.vstemplate" }
Write-Host "E2E.Templates.AutoDiscovery VSIX verified successfully"
- name: Verify E2E.Templates.Reference VSIX
run: |
$vsix = "tests/e2e/E2E.Templates.Reference/bin/Release/net472/E2E.Templates.Reference.vsix"
if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" }
Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.Reference/vsix-contents" -Force
$files = Get-ChildItem -Path "tests/e2e/E2E.Templates.Reference/vsix-contents" -Recurse | Select-Object -ExpandProperty Name
# Verify templates copied from referenced project are included
if ($files -notcontains "RefProject.vstemplate") { throw "Missing ProjectTemplates/ProjectTemplate/RefProject.vstemplate" }
if ($files -notcontains "RefItem.vstemplate") { throw "Missing ItemTemplates/ItemTemplate/RefItem.vstemplate" }
Write-Host "E2E.Templates.Reference VSIX verified successfully"
- name: Verify E2E.Templates.ReferenceManual VSIX
run: |
$vsix = "tests/e2e/E2E.Templates.ReferenceManual/bin/Release/net472/E2E.Templates.ReferenceManual.vsix"
if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" }
Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.ReferenceManual/vsix-contents" -Force
$files = Get-ChildItem -Path "tests/e2e/E2E.Templates.ReferenceManual/vsix-contents" -Recurse | Select-Object -ExpandProperty Name
# Verify templates copied from referenced project are included (manual manifest)
if ($files -notcontains "RefProject.vstemplate") { throw "Missing ProjectTemplates/ProjectTemplate/RefProject.vstemplate" }
if ($files -notcontains "RefItem.vstemplate") { throw "Missing ItemTemplates/ItemTemplate/RefItem.vstemplate" }
Write-Host "E2E.Templates.ReferenceManual VSIX verified successfully"
- name: Verify E2E.AllFeatures VSIX
run: |
$vsix = "tests/e2e/E2E.AllFeatures/bin/Release/net472/E2E.AllFeatures.vsix"
if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" }
Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.AllFeatures/vsix-contents" -Force
$files = Get-ChildItem -Path "tests/e2e/E2E.AllFeatures/vsix-contents" -Recurse | Select-Object -ExpandProperty Name
if ($files -notcontains "extension.vsixmanifest") { throw "Missing extension.vsixmanifest" }
if ($files -notcontains "E2E.AllFeatures.dll") { throw "Missing E2E.AllFeatures.dll" }
Write-Host "E2E.AllFeatures VSIX verified successfully"
- name: Verify E2E.Templates.AutoInject VSIX
run: |
$vsix = "tests/e2e/E2E.Templates.AutoInject/bin/Release/net472/E2E.Templates.AutoInject.vsix"
if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" }
Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.AutoInject/vsix-contents" -Force
$files = Get-ChildItem -Path "tests/e2e/E2E.Templates.AutoInject/vsix-contents" -Recurse | Select-Object -ExpandProperty Name
# Verify template was included (Content was auto-injected)
if ($files -notcontains "TestProject.vstemplate") { throw "Missing ProjectTemplates/TestProject/TestProject.vstemplate" }
Write-Host "E2E.Templates.AutoInject VSIX verified successfully"
- name: Test Template - Install
run: dotnet new install artifacts/packages/CodingWithCalvin.VsixSdk.Templates.1.0.0.nupkg
- name: Test Template - Create Project
run: |
mkdir test-template
cd test-template
dotnet new vsix -n TestExtension --publisher "CI Test"
- name: Test Template - Build Project
run: dotnet build test-template/TestExtension/TestExtension.csproj -c Release
- name: Test Template - Uninstall
run: dotnet new uninstall CodingWithCalvin.VsixSdk.Templates
- name: Upload SDK Package
uses: actions/upload-artifact@v4
with:
name: sdk-package
path: artifacts/packages/CodingWithCalvin.VsixSdk.*.nupkg
- name: Upload Templates Package
uses: actions/upload-artifact@v4
with:
name: templates-package
path: artifacts/packages/CodingWithCalvin.VsixSdk.Templates.*.nupkg