-
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (114 loc) · 6.28 KB
/
build.yml
File metadata and controls
146 lines (114 loc) · 6.28 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
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.PreBuiltZip
run: dotnet build tests/e2e/E2E.Templates.PreBuiltZip/E2E.Templates.PreBuiltZip.csproj -c Release
- name: Build E2E.Templates.CrossProjectRef
run: dotnet build tests/e2e/E2E.Templates.CrossProjectRef/E2E.Templates.CrossProjectRef.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
# VSIX Verification - Check that VSIX files contain expected content
- name: Verify E2E.Minimal VSIX
run: |
$vsix = "tests/e2e/E2E.Minimal/bin/Release/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/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
if ($files -notcontains "ConsoleApp.zip") { throw "Missing ProjectTemplates/ConsoleApp.zip" }
if ($files -notcontains "NewClass.zip") { throw "Missing ItemTemplates/NewClass.zip" }
Write-Host "E2E.Templates.AutoDiscovery VSIX verified successfully"
- name: Verify E2E.AllFeatures VSIX
run: |
$vsix = "tests/e2e/E2E.AllFeatures/bin/Release/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: 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