Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions build/AzurePipelinesTemplates/WinUI-RunStaticTests-Job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
runTestJobName: 'RunStaticTests'
dependsOn: ''
MUXFinalRelease: false
windowsAppSdkVersion: 'latest'

jobs:
- job: ${{ parameters.runTestJobName }}
Expand All @@ -15,9 +16,14 @@ jobs:
variables:
artifactsDir: $(Build.SourcesDirectory)\Artifacts
packagesDir: $(Agent.TempDirectory)\WinUI-RunStaticTests-Job\packages
winMDVersionVerifyLcrVersion: 'latest'
ob_outputDirectory: '$(Build.SourcesDirectory)\out'
ob_sdl_codeSignValidation_excludes: '-|packaging\**;-|**\Test\**;-|**\Taef\**;-|**\TestDependencies\**;-|**\Microsoft.Internal.FrameworkUdk.dll'
ob_sdl_prefast_enabled: false # this job does no native build
${{ if ne(parameters.windowsAppSdkVersion, 'latest') }}:
windowsAppSdkVersionArgument: '-Version ${{ parameters.windowsAppSdkVersion }}'
${{ else }}:
windowsAppSdkVersionArgument: ''

steps:
# This is a temporarily workaround to avoid getting non-fatal "folder C:\__t\NativeCompilerPrefast not found"
Expand All @@ -31,26 +37,30 @@ jobs:
gci env:* | sort-object name
displayName: Display build machine environment variable

# Authenticate to NuGet feeds used by this pipeline (WinUI.Dependencies has nuget.org as an upstream source,
# so public releases are available through it without direct nuget.org access)
# Fork PRs must not authenticate to private package feeds.
- task: NuGetAuthenticate@1
displayName: 'NuGet Authenticate'
displayName: 'Authenticate to WinUI.Dependencies'
condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'))

# In this pipeline configuration, 'NuGetCommand' is ambiguous so the specific task guid must be used instead
# See known NuGet task issue notes.
# The latest public release is resolved via the WinUI.Dependencies feed (which has nuget.org as an upstream)
# The package is installed into a temp directory to ensure it doesn't get used elsewhere for a build
# Install the latest public release by default, or the version supplied by the caller.
- task: NuGetCommand@2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious why this version update is needed? Did we introduce a dependency for static tests recently?

And even if we did, now that we are pulling it from private feed, shouldn't it already be available?

displayName: 'NuGet install Microsoft.WindowsAppSDK'
inputs:
command: 'custom'
arguments: 'install Microsoft.WindowsAppSDK -OutputDirectory $(packagesDir) -ConfigFile $(Build.SourcesDirectory)\nuget.config'
arguments: 'install Microsoft.WindowsAppSDK $(windowsAppSdkVersionArgument) -OutputDirectory $(packagesDir) -ConfigFile $(Build.SourcesDirectory)\nuget.config -NonInteractive'

- task: NuGetCommand@2
displayName: 'NuGet install WinMDVersionVerifyLcr'
- task: DownloadPackage@1
displayName: 'Download WinMDVersionVerifyLcr $(winMDVersionVerifyLcrVersion)'
condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'))
inputs:
command: 'custom'
arguments: 'install WinMDVersionVerifyLcr -OutputDirectory $(packagesDir) -ConfigFile $(Build.SourcesDirectory)\nuget.config'
packageType: 'nuget'
feed: 'WinUI.Dependencies'
definition: 'WinMDVersionVerifyLcr'
version: '$(winMDVersionVerifyLcrVersion)'
extract: true
downloadPath: '$(packagesDir)\WinMDVersionVerifyLcr\$(winMDVersionVerifyLcrVersion)'

- template: WinUI-DownloadPipelineArtifacts-Steps.yml
parameters:
Expand All @@ -61,8 +71,14 @@ jobs:

- task: powershell@2
displayName: 'Run WinMD Compat Test'
condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'))
inputs:
targetType: filePath
filePath: $(Build.SourcesDirectory)\build\PipelineScripts\VerifyWinMDCompat.ps1
arguments: -WinMDPath '$(artifactsDir)\packaging\Release\lib\uap10.0' -PackagesDirectory '$(packagesDir)' -isRelease:$${{ parameters.MUXFinalRelease }}
arguments: -WinMDPath '$(artifactsDir)\packaging\Release\lib\uap10.0' -PackagesDirectory '$(packagesDir)' -WinMDVersionVerifyLcrVersion '$(winMDVersionVerifyLcrVersion)' -isRelease:$${{ parameters.MUXFinalRelease }}
pwsh: true

- powershell: |
Write-Host "WinMD compatibility validation is not available for fork PRs."
displayName: 'Skip WinMD compatibility validation'
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'True'))
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Licensed under the MIT License.
parameters:
MUXFinalRelease: false
windowsAppSdkVersion: 'latest'

stages:
- stage: RunStaticTests
Expand All @@ -12,4 +13,5 @@ stages:
- template: WinUI-RunStaticTests-Job.yml
parameters:
runTestJobName: RunStaticTests
MUXFinalRelease: ${{ parameters.MUXFinalRelease }}
MUXFinalRelease: ${{ parameters.MUXFinalRelease }}
windowsAppSdkVersion: ${{ parameters.windowsAppSdkVersion }}
13 changes: 12 additions & 1 deletion build/PipelineScripts/VerifyWinMDCompat.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ param(
[Parameter(Mandatory = $false)]
[string]$WinAppSDKWinUIVersion = "",
[Parameter(Mandatory = $false)]
[string]$WinMDVersionVerifyLcrVersion = "",
[Parameter(Mandatory = $false)]
[bool]$isRelease = $false
)

Expand Down Expand Up @@ -108,7 +110,16 @@ if (-not $env:BUILD_BUILDID)
$nugetResultCode = $?
}

$WinMDVersionVerifyLcrVersionToUse = Get-LatestVersion "WinMDVersionVerifyLcr"
if ($WinMDVersionVerifyLcrVersion)
{
$WinMDVersionVerifyLcrVersionToUse = $WinMDVersionVerifyLcrVersion
Write-Host "Specific WinMDVersionVerifyLcr version specified: $WinMDVersionVerifyLcrVersionToUse"
}
else
{
$WinMDVersionVerifyLcrVersionToUse = Get-LatestVersion "WinMDVersionVerifyLcr"
}

$winMDVersionVerifyLcrPath = [System.IO.Path]::Combine($PackagesDirectory, "WinMDVersionVerifyLcr", $WinMDVersionVerifyLcrVersionToUse, "WinMDVersionVerifyLcr.exe")
if (-not (Test-Path $winMDVersionVerifyLcrPath))
{
Expand Down
2 changes: 1 addition & 1 deletion build/WinUI-GitHub-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ extends:
failOnTestFailure: false

- ${{ if eq(parameters.runFullValidation, true) }}:
- template: build\AzurePipelinesTemplates\WinUI-RunStaticTests-Stage.yml@WinUIInternal
- template: AzurePipelinesTemplates\WinUI-RunStaticTests-Stage.yml
parameters:
MUXFinalRelease: ${{ parameters.MUXFinalRelease }}

Expand Down
Loading