Skip to content

[CI] Add support in local environment #20365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 5, 2022
Merged
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
13 changes: 10 additions & 3 deletions tools/ExecuteCIStep.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Usage: 1. This script can be called by build.proj used in CI pipeline
# 2. Can be used to do static analysis in local env. Such as: .\tools\ExecuteCIStep.ps1 -StaticAnalysisSignature -TargetModule "Accounts;Compute"
# 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.
Param(
[Switch]
$Build,
Expand Down Expand Up @@ -199,12 +200,18 @@ If ($Build)
Return
}

If (-Not $PSBoundParameters.ContainsKey("TargetModule"))
$CIPlanPath = "$RepoArtifacts/PipelineResult/CIPlan.json"
If (Test-Path $CIPlanPath)
{
$CIPlan = Get-Content $RepoArtifacts/PipelineResult/CIPlan.json | ConvertFrom-Json
$CIPlan = Get-Content $CIPlanPath | ConvertFrom-Json
}
ElseIf (-Not $PSBoundParameters.ContainsKey("TargetModule"))
{
$TargetModule = Get-ChildItem "$RepoArtifacts/$Configuration" | ForEach-Object { $_.Name.Replace("Az.", "") } | Join-String -Separator ';'
$PSBoundParameters["TargetModule"] = $TargetModule
}

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