加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.vsts-ci.yml 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
Nick Randolph 提交于 2023-05-02 11:51 . fix: updating canary updater
jobs:
- job: VS_Latest
timeoutInMinutes: 600
pool:
vmImage: windows-2022
steps:
- checkout: self
clean: true
- powershell: |
if($env:System_PullRequest_TargetBranch -eq $null) { $TargetBranch = "master" } else { $TargetBranch = $env:System_PullRequest_TargetBranch; }
$dict = New-Object 'System.Collections.Generic.Dictionary[String,System.Collections.Generic.Dictionary[String,String]]'
$samples = Get-ChildItem -Path **\*.sln -Recurse | Where-Object {$_.FullName -notmatch "\\ArchivedProjects\\"}
foreach($sample in $samples){
$solutionPath=[System.IO.Path]::GetDirectoryName($sample.FullName);
Write-Host "$solutionPath"
git diff --quiet HEAD "origin/$TargetBranch" -- "$solutionPath"
# Only build if there a change in the solution path for the current PR, if we're not in a PR
if( ("$env:System_PullRequest_PullRequestId" -eq '') -or ($global:LASTEXITCODE -ne 0)) {
Write-Host "Adding $solutionPath"
$item = New-Object 'System.Collections.Generic.Dictionary[String,String]'
$item.Add("solutionPath", $sample.FullName)
$name = $sample.Name.Split(".")[0]
if(!$dict.ContainsKey($name)){
$dict.Add($name, $item)
}
}
$global:LASTEXITCODE = 0
}
$SolutionsJson = $dict | ConvertTo-Json -Compress
Write-Host $SolutionsJson
Write-Host "##vso[task.setvariable variable=samplesJson;isOutput=true]$SolutionsJson"
name: generateJson
displayName: Generate Json of Samples
- template: .azure-pipelines.BuildMatrix.yml
# - task: PublishBuildArtifacts@1
# inputs:
# pathtoPublish: $(Build.ArtifactStagingDirectory)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化