Skip to content

Commit 1dc4103

Browse files
wyunchi-msmsJinLei
andauthored
[CI] Add support in local environment (#20365)
* Add support in local environment * Add support in local environment * Update tools/ExecuteCIStep.ps1 Co-authored-by: Jin Lei <[email protected]> Co-authored-by: Jin Lei <[email protected]>
1 parent 98885f3 commit 1dc4103

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/ExecuteCIStep.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# Usage: 1. This script can be called by build.proj used in CI pipeline
1717
# 2. Can be used to do static analysis in local env. Such as: .\tools\ExecuteCIStep.ps1 -StaticAnalysisSignature -TargetModule "Accounts;Compute"
18+
# 3. Can run static analyis for all the module built in artifacts. Such as: .\tools\ExecuteCIStep.ps1 -StaticAnalysisSignature will run static analysis signature check for all the modules under artifacts/debug.
1819
Param(
1920
[Switch]
2021
$Build,
@@ -199,12 +200,18 @@ If ($Build)
199200
Return
200201
}
201202

202-
If (-Not $PSBoundParameters.ContainsKey("TargetModule"))
203+
$CIPlanPath = "$RepoArtifacts/PipelineResult/CIPlan.json"
204+
If (Test-Path $CIPlanPath)
203205
{
204-
$CIPlan = Get-Content $RepoArtifacts/PipelineResult/CIPlan.json | ConvertFrom-Json
206+
$CIPlan = Get-Content $CIPlanPath | ConvertFrom-Json
207+
}
208+
ElseIf (-Not $PSBoundParameters.ContainsKey("TargetModule"))
209+
{
210+
$TargetModule = Get-ChildItem "$RepoArtifacts/$Configuration" | ForEach-Object { $_.Name.Replace("Az.", "") } | Join-String -Separator ';'
211+
$PSBoundParameters["TargetModule"] = $TargetModule
205212
}
206213

207-
If ($Test -And $CIPlan.test.Length -Ne 0)
214+
If ($Test -And (($CIPlan.test.Length -Ne 0) -Or ($PSBoundParameters.ContainsKey("TargetModule"))))
208215
{
209216
dotnet test $RepoArtifacts/Azure.PowerShell.sln --filter "AcceptanceType=CheckIn&RunType!=DesktopOnly" --configuration $Configuration --framework $TestFramework --logger trx --results-directory $TestOutputDirectory
210217
Return

0 commit comments

Comments
 (0)