PowerToys/.pipelines/ci/templates/build-powertoys-steps.yml
Jeremy Sinclair a7bd0cfde8
[deps]Upgrade to .NET 7 (#20979)
* Update projects to .NET 7

* Updated packages to 7.0-rc1

* [ColorPicker] Wrap WM_KEYUP param in unchecked context

* [PTRun][OneNote] Added a NoWarn to CS8981

* [MeasureTool] Wrap buffer in wstring_view in SetClipBoardToText

* Target .NET 7 for PowerToys.Interop

* Update publish profiles

* Removed System.Text.Json.dll from Product.wxs since it's included in .NET 7

* Use .NET 7 in CI

* Removed individual CodeAnalysis package from projects

* Updated CodeAnalysis package in Directory.Build.props

* Updated NuGet packages to latest 7.0 rc2

* Fix merge mistake with Settings.UI.Library project

* Updated installer with .NET 7 RC2 install

* [GPOWrapper] Updated GPOWrapperProjection to .NET 7

* [FileLockSmith] Updated to .NET 7

* [FileLocksmith] Update Interop to .NET 7

* Upgrade .NET 7 specific libraries to GA version

* [PowerToysSetup] Updated .NET 7 urls to GA

* [CI] removed .NET 7 SDK preview version from UseDotNet task

* [PowerToysSetup] Update HasDotnet variable name

* [PowerToysInterop] Downgrade target back to .NET 6

* [FileLockSmith] Downgrade Interop library back to .NET 6

* Revert "[FileLockSmith] Downgrade Interop library back to .NET 6"

This reverts commit 356ad048e3.

* Revert "[PowerToysInterop] Downgrade target back to .NET 6"

This reverts commit 74dbcfdefe.

* [Analyzers][CPP] Disable warning for 4679 caused by .NET 7 in C++/CLI

* [CI] Set maximum cpu count to 2 for PowerToys.sln build

* [CI] Set maximumCpuCount to false in hopes of arm64 working

* Changed .NET 7 runtime display name

* [ci] Use .net 7 sdk
2022-12-01 14:40:41 +00:00

230 lines
7.4 KiB
YAML

parameters:
additionalBuildArguments: ''
steps:
- checkout: self
fetchDepth: 1
submodules: true
clean: true
- task: PowerShell@2
displayName: Verifying Nuget packages for PowerToys.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyNugetPackages.ps1'
arguments: -solution '$(build.sourcesdirectory)\PowerToys.sln'
pwsh: true
- task: PowerShell@2
displayName: Verify Arm64 configuration for PowerToys.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
arguments: -solution '$(build.sourcesdirectory)\PowerToys.sln'
pwsh: true
- task: PowerShell@2
displayName: Verify Arm64 configuration for BugReportTool.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
arguments: -solution '$(build.sourcesdirectory)\tools\BugReportTool\BugReportTool.sln'
pwsh: true
- task: PowerShell@2
displayName: Verify Arm64 configuration for WebcamReportTool.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
arguments: -solution '$(build.sourcesdirectory)\tools\WebcamReportTool\WebcamReportTool.sln'
pwsh: true
- task: PowerShell@2
displayName: Verify Arm64 configuration for StylesReportTool.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
arguments: -solution '$(build.sourcesdirectory)\tools\StylesReportTool\StylesReportTool.sln'
pwsh: true
- task: PowerShell@2
displayName: Verify Arm64 configuration for PowerToysSetup.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyArm64Configuration.ps1'
arguments: -solution '$(build.sourcesdirectory)\installer\PowerToysSetup.sln'
pwsh: true
- task: UseDotNet@2
displayName: 'Use .NET 7 SDK'
inputs:
packageType: sdk
version: '7.x'
- task: NuGetToolInstaller@1
displayName: Ensure NuGet Installer
- task: VisualStudioTestPlatformInstaller@1
displayName: Ensure VSTest Platform
- task: NuGetCommand@2
displayName: Restore NuGet packages for PowerToys.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: PowerToys.sln
restoreDirectory: '$(Build.SourcesDirectory)\packages'
- task: VSBuild@1
displayName: 'Build PowerToys.sln'
inputs:
solution: '**\PowerToys.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for BugReportTool.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: tools\BugReportTool\BugReportTool.sln
restoreDirectory: '$(Build.SourcesDirectory)\tools\BugReportTool\packages'
- task: VSBuild@1
displayName: 'Build BugReportTool.sln'
inputs:
solution: '**\BugReportTool.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for WebcamReportTool.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: tools\WebcamReportTool\WebcamReportTool.sln
restoreDirectory: '$(Build.SourcesDirectory)\tools\WebcamReportTool\packages'
- task: VSBuild@1
displayName: 'Build WebcamReportTool.sln'
inputs:
solution: '**\WebcamReportTool.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: NuGetCommand@2
displayName: Restore NuGet packages for StylesReportTool.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: tools\StylesReportTool\StylesReportTool.sln
restoreDirectory: '$(Build.SourcesDirectory)\tools\StylesReportTool\packages'
- task: VSBuild@1
displayName: 'Build StylesReportTool.sln'
inputs:
solution: '**\StylesReportTool.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: PowerShell@2
displayName: Download and install WiX 3.14 development build
inputs:
targetType: filePath
filePath: '$(build.sourcesdirectory)\.pipelines\installWiX.ps1'
- task: NuGetCommand@2
displayName: Restore NuGet packages for PowerToysSetup.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: installer\PowerToysSetup.sln
restoreDirectory: '$(Build.SourcesDirectory)\installer\packages'
- task: VSBuild@1
displayName: 'Build PowerToys MSI'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysInstaller ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true
- task: VSBuild@1
displayName: 'Build PowerToys Bootstrapper'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysBootstrapper ${{ parameters.additionalBuildArguments }}
clean: false
maximumCpuCount: true
# directly not doing WinAppDriver testing
- task: VSTest@2
displayName: 'MS Tests'
condition: ne(variables['BuildPlatform'], 'arm64') # No arm64 agents to run the tests.
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\UnitTests-GcodeThumbnailProvider.dll
**\UnitTests-StlThumbnailProvider.dll
**\UnitTests-PdfThumbnailProvider.dll
**\Settings.UI.UnitTests.dll
**\UnitTests-GcodePreviewHandler.dll
**\UnitTests-PdfPreviewHandler.dll
**\UnitTests-PreviewHandlerCommon.dll
**\Microsoft.PowerToys.Run.Plugin.Registry.UnitTests.dll
**\UnitTest-ColorPickerUI.dll
**\Microsoft.Interop.Tests.dll
**\ImageResizer.Test.dll
**\Community.PowerToys.Run.Plugin.UnitConverter.UnitTest.dll
**\Microsoft.Plugin.Folder.UnitTests.dll
**\Microsoft.Plugin.Program.UnitTests.dll
**\Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest.dll
**\Microsoft.Plugin.Uri.UnitTests.dll
**\Wox.Test.dll
**\Microsoft.PowerToys.Run.Plugin.System.UnitTests.dll
**\Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests.dll
**\Microsoft.PowerToys.Run.Plugin.TimeZone.UnitTests.dll
**\Microsoft.Plugin.WindowsTerminal.UnitTests.dll
**\Microsoft.Plugin.WindowWalker.UnitTests.dll
**\PreviewPaneUnitTests.dll
**\UnitTests-SvgThumbnailProvider.dll
**\UnitTests-SvgPreviewHandler.dll
**\PowerToys.Hosts.Tests.dll
!**\obj\**
!**\ref\**
# Native dlls
- task: VSTest@2
condition: ne(variables['BuildPlatform'],'arm64') # No arm64 agents to run the tests.
displayName: 'Native Tests'
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\KeyboardManagerEngineTest.dll
**\KeyboardManagerEditorTest.dll
**\UnitTests-CommonLib.dll
**\PowerRenameUnitTests.dll
**\powerpreviewTest.dll
**\UnitTests-FancyZones.dll
!**\obj\**