Skip to content

Commit 50ddb41

Browse files
authored
Add CI Pipline to Build All Samples (microsoft#253)
* pipeline to build all samples * update docs
1 parent 7199012 commit 50ddb41

File tree

4 files changed

+110
-1
lines changed

4 files changed

+110
-1
lines changed

SamplesCI-All.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Please see https://www.osgwiki.com/wiki/Windows_App_SDK_-_How_to_build_and_use_the_pipelines
2+
# for information on how to use the pipelines
3+
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
4+
parameters:
5+
- name: FeatureAreas
6+
type: object
7+
default:
8+
- 'AppLifecycle\Activation'
9+
- 'AppLifecycle\EnvironmentVariables'
10+
- 'AppLifecycle\Restart'
11+
- 'AppLifecycle\Instancing'
12+
- 'AppLifecycle\StateNotifications'
13+
- 'DeploymentManager'
14+
- 'CustomControls'
15+
- 'Insights'
16+
- 'Input/cs-winui'
17+
- 'Installer'
18+
- 'Mica'
19+
- 'Notifications'
20+
- 'PhotoEditor'
21+
- 'ResourceManagement'
22+
- 'SelfContainedDeployment'
23+
- 'TextRendering'
24+
- 'Unpackaged'
25+
- 'Windowing'
26+
- name: "BuildConfig"
27+
type: object
28+
default:
29+
- 'Release'
30+
- 'Debug'
31+
- name: "BuildPlatform"
32+
type: object
33+
default:
34+
- 'x64'
35+
- 'x86'
36+
37+
jobs:
38+
- job: 'BuildAllSamples'
39+
pool: 'ProjectReunionSamplesESPool-MS'
40+
timeoutInMinutes: 120
41+
strategy:
42+
maxParallel: 10
43+
matrix:
44+
${{ each featureArea in parameters.FeatureAreas }}:
45+
${{ featureArea }}:
46+
feature: ${{ featureArea }}
47+
48+
steps:
49+
- task: NuGetToolInstaller@1
50+
displayName: 'Use NuGet 5.11.0'
51+
inputs:
52+
versionSpec: 5.11.0
53+
54+
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
55+
- script: |
56+
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -prerelease -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
57+
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
58+
del %TEMP%\vsinstalldir.txt
59+
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
60+
echo VCToolsInstallDir = %VCToolsInstallDir%
61+
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
62+
displayName: 'Retrieve VC tools directory'
63+
64+
#====================================================================================================================
65+
- task: NuGetCommand@2
66+
inputs:
67+
command: 'restore'
68+
feedsToUse: 'config'
69+
nugetConfigPath: '.\Samples\nuget.config'
70+
restoreSolution: '.\Samples\$(feature)\**\*.sln'
71+
72+
- ${{ each config in parameters.BuildConfig }}:
73+
- ${{ each platform in parameters.BuildPlatform }}:
74+
- task: VSBuild@1
75+
displayName: 'Restore nuget packages for all solutions'
76+
inputs:
77+
solution: .\Samples\$(feature)\**\*.sln
78+
platform: '${{ platform }}'
79+
configuration: '${{ config }}'
80+
msbuildArgs: '/t:restore /p:PublishReadyToRun=true /p:VCToolsInstallDir="$(VCToolsInstallDir)\"'
81+
82+
- task: VSBuild@1
83+
displayName: 'Build all Sample solutions'
84+
inputs:
85+
solution: .\Samples\$(feature)\**\*.sln
86+
platform: '${{ platform }}'
87+
configuration: '${{ config }}'
88+
msbuildArgs: '/p:VCToolsInstallDir="$(VCToolsInstallDir)\"'

WindowsAppSDK-SamplesCI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ stages:
6060
solution: .\Samples\${{ parameters.FeatureDirectory }}\**\*.sln
6161
platform: '$(buildPlatform)'
6262
configuration: '$(buildConfiguration)'
63-
msbuildArgs: '/p:VCToolsInstallDir="$(VCToolsInstallDir)\"'
63+
msbuildArgs: '/p:VCToolsInstallDir="$(VCToolsInstallDir)\"'

docs/samples-guidelines.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ stages:
482482
parameters:
483483
FeatureDirectory: "<FeatureName>"
484484
```
485+
486+
Be sure to add the new `<FeatureName>` to the `FeatureAreas` parameter in `SamplesCI-All.yml`.
487+
485488
##### Creating the pipeline
486489

487490
Go to https://dev.azure.com/ms/ProjectReunion/_build

docs/version-update-process.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Windows App SDK Samples Version Update Process
2+
3+
This document outlines the steps that should be followed when updating version data for the Windows App SDK Samples in this repo.
4+
5+
## Checklist
6+
7+
1. Create a branch off of main
8+
2. Run the [update script](../UpdateVersions.cmd) on your local machine
9+
3. Run the [local test script](../build.cmd)
10+
4. Push changes
11+
5. Create PR
12+
6. Run build pipelines - SamplesCI-All will build every sample
13+
7. Create an issue in the repo of each problem to be addressed
14+
8. Assign the issue to samples owners
15+
9. Revert broken changes
16+
10. Merge
17+
11. Once any issues are resolved, samples owners create their own PRs
18+
12. Separate PRs are reviewed and merged

0 commit comments

Comments
 (0)