|
| 1 | +param( |
| 2 | + [ValidateSet('All', 'Build', 'HeadlessAutomation', 'GoldenTests', 'PIRuntime', 'PerfSmoke')] |
| 3 | + [string]$Lane = 'All', |
| 4 | + [string]$EngineRoot = '', |
| 5 | + [string]$UnrealBuildToolPath = '', |
| 6 | + [string]$EditorCmdPath = '', |
| 7 | + [string]$ProjectPath = '', |
| 8 | + [int]$PerfSmokeMaxTotalSeconds = 900, |
| 9 | + [int]$PerfSmokeMaxPerScenarioSeconds = 360 |
| 10 | +) |
| 11 | + |
| 12 | +Set-StrictMode -Version Latest |
| 13 | +$ErrorActionPreference = 'Stop' |
| 14 | + |
| 15 | +. (Join-Path $PSScriptRoot 'VergilCICommon.ps1') |
| 16 | + |
| 17 | +$projectRoot = Get-VergilProjectRoot |
| 18 | +$resolvedProjectPath = Resolve-VergilProjectPath -ProjectPath $ProjectPath |
| 19 | +$resolvedEditorCmdPath = Resolve-VergilEditorCmdPath -EditorCmdPath $EditorCmdPath -EngineRoot $EngineRoot |
| 20 | +$resolvedUnrealBuildToolPath = Resolve-VergilUnrealBuildToolPath -UnrealBuildToolPath $UnrealBuildToolPath -EngineRoot $EngineRoot |
| 21 | +$automationScriptPath = Join-Path $PSScriptRoot 'Invoke-VergilScaffoldAutomation.ps1' |
| 22 | +$buildScriptPath = Join-Path $PSScriptRoot 'Invoke-VergilProjectBuild.ps1' |
| 23 | +$perfSmokeScriptPath = Join-Path $PSScriptRoot 'Invoke-VergilPerfSmoke.ps1' |
| 24 | + |
| 25 | +function Invoke-VergilAutomationLane { |
| 26 | + param( |
| 27 | + [Parameter(Mandatory = $true)] |
| 28 | + [string]$LaneName, |
| 29 | + |
| 30 | + [Parameter(Mandatory = $true)] |
| 31 | + [string]$TestFilter, |
| 32 | + |
| 33 | + [string]$LogFileName = 'Automation.log' |
| 34 | + ) |
| 35 | + |
| 36 | + $outputDirectory = Get-VergilCILaneOutputDirectory -Lane $LaneName -ProjectRoot $projectRoot |
| 37 | + Reset-VergilDirectory -Path $outputDirectory |
| 38 | + |
| 39 | + Invoke-VergilPowerShellFile ` |
| 40 | + -ScriptPath $automationScriptPath ` |
| 41 | + -WorkingDirectory $projectRoot ` |
| 42 | + -Arguments @( |
| 43 | + '-EditorCmdPath', $resolvedEditorCmdPath, |
| 44 | + '-ProjectPath', $resolvedProjectPath, |
| 45 | + '-TestFilter', $TestFilter, |
| 46 | + '-LogPath', (Join-Path $outputDirectory $LogFileName) |
| 47 | + ) |
| 48 | +} |
| 49 | + |
| 50 | +switch ($Lane) { |
| 51 | + 'All' { |
| 52 | + $buildOutputDirectory = Get-VergilCILaneOutputDirectory -Lane 'Build' -ProjectRoot $projectRoot |
| 53 | + Reset-VergilDirectory -Path $buildOutputDirectory |
| 54 | + Invoke-VergilPowerShellFile ` |
| 55 | + -ScriptPath $buildScriptPath ` |
| 56 | + -WorkingDirectory $projectRoot ` |
| 57 | + -Arguments @( |
| 58 | + '-ProjectPath', $resolvedProjectPath, |
| 59 | + '-UnrealBuildToolPath', $resolvedUnrealBuildToolPath, |
| 60 | + '-LogPath', (Join-Path $buildOutputDirectory 'UnrealBuildTool.log') |
| 61 | + ) |
| 62 | + |
| 63 | + Invoke-VergilAutomationLane -LaneName 'HeadlessAutomation' -TestFilter 'Vergil.Scaffold' -LogFileName 'VergilAutomation_HeadlessAutomation.log' |
| 64 | + Invoke-VergilAutomationLane -LaneName 'GoldenTests' -TestFilter 'Vergil.Scaffold.GoldenAssetSnapshot' -LogFileName 'GoldenAssetSnapshot.log' |
| 65 | + |
| 66 | + $goldenOutputDirectory = Get-VergilCILaneOutputDirectory -Lane 'GoldenTests' -ProjectRoot $projectRoot |
| 67 | + Invoke-VergilPowerShellFile ` |
| 68 | + -ScriptPath $automationScriptPath ` |
| 69 | + -WorkingDirectory $projectRoot ` |
| 70 | + -Arguments @( |
| 71 | + '-EditorCmdPath', $resolvedEditorCmdPath, |
| 72 | + '-ProjectPath', $resolvedProjectPath, |
| 73 | + '-TestFilter', 'Vergil.Scaffold.SourceControlDiff', |
| 74 | + '-LogPath', (Join-Path $goldenOutputDirectory 'SourceControlDiff.log') |
| 75 | + ) |
| 76 | + |
| 77 | + Invoke-VergilAutomationLane -LaneName 'PIRuntime' -TestFilter 'Vergil.Scaffold.PIERuntime' -LogFileName 'PIERuntime.log' |
| 78 | + Invoke-VergilPowerShellFile ` |
| 79 | + -ScriptPath $perfSmokeScriptPath ` |
| 80 | + -WorkingDirectory $projectRoot ` |
| 81 | + -Arguments @( |
| 82 | + '-EditorCmdPath', $resolvedEditorCmdPath, |
| 83 | + '-ProjectPath', $resolvedProjectPath, |
| 84 | + '-MaxTotalSeconds', $PerfSmokeMaxTotalSeconds, |
| 85 | + '-MaxPerScenarioSeconds', $PerfSmokeMaxPerScenarioSeconds |
| 86 | + ) |
| 87 | + } |
| 88 | + 'Build' { |
| 89 | + $buildOutputDirectory = Get-VergilCILaneOutputDirectory -Lane 'Build' -ProjectRoot $projectRoot |
| 90 | + Reset-VergilDirectory -Path $buildOutputDirectory |
| 91 | + Invoke-VergilPowerShellFile ` |
| 92 | + -ScriptPath $buildScriptPath ` |
| 93 | + -WorkingDirectory $projectRoot ` |
| 94 | + -Arguments @( |
| 95 | + '-ProjectPath', $resolvedProjectPath, |
| 96 | + '-UnrealBuildToolPath', $resolvedUnrealBuildToolPath, |
| 97 | + '-LogPath', (Join-Path $buildOutputDirectory 'UnrealBuildTool.log') |
| 98 | + ) |
| 99 | + } |
| 100 | + 'HeadlessAutomation' { |
| 101 | + Invoke-VergilAutomationLane -LaneName 'HeadlessAutomation' -TestFilter 'Vergil.Scaffold' -LogFileName 'VergilAutomation_HeadlessAutomation.log' |
| 102 | + } |
| 103 | + 'GoldenTests' { |
| 104 | + $outputDirectory = Get-VergilCILaneOutputDirectory -Lane 'GoldenTests' -ProjectRoot $projectRoot |
| 105 | + Reset-VergilDirectory -Path $outputDirectory |
| 106 | + |
| 107 | + Invoke-VergilPowerShellFile ` |
| 108 | + -ScriptPath $automationScriptPath ` |
| 109 | + -WorkingDirectory $projectRoot ` |
| 110 | + -Arguments @( |
| 111 | + '-EditorCmdPath', $resolvedEditorCmdPath, |
| 112 | + '-ProjectPath', $resolvedProjectPath, |
| 113 | + '-TestFilter', 'Vergil.Scaffold.GoldenAssetSnapshot', |
| 114 | + '-LogPath', (Join-Path $outputDirectory 'GoldenAssetSnapshot.log') |
| 115 | + ) |
| 116 | + |
| 117 | + Invoke-VergilPowerShellFile ` |
| 118 | + -ScriptPath $automationScriptPath ` |
| 119 | + -WorkingDirectory $projectRoot ` |
| 120 | + -Arguments @( |
| 121 | + '-EditorCmdPath', $resolvedEditorCmdPath, |
| 122 | + '-ProjectPath', $resolvedProjectPath, |
| 123 | + '-TestFilter', 'Vergil.Scaffold.SourceControlDiff', |
| 124 | + '-LogPath', (Join-Path $outputDirectory 'SourceControlDiff.log') |
| 125 | + ) |
| 126 | + } |
| 127 | + 'PIRuntime' { |
| 128 | + Invoke-VergilAutomationLane -LaneName 'PIRuntime' -TestFilter 'Vergil.Scaffold.PIERuntime' -LogFileName 'PIERuntime.log' |
| 129 | + } |
| 130 | + 'PerfSmoke' { |
| 131 | + Invoke-VergilPowerShellFile ` |
| 132 | + -ScriptPath $perfSmokeScriptPath ` |
| 133 | + -WorkingDirectory $projectRoot ` |
| 134 | + -Arguments @( |
| 135 | + '-EditorCmdPath', $resolvedEditorCmdPath, |
| 136 | + '-ProjectPath', $resolvedProjectPath, |
| 137 | + '-MaxTotalSeconds', $PerfSmokeMaxTotalSeconds, |
| 138 | + '-MaxPerScenarioSeconds', $PerfSmokeMaxPerScenarioSeconds |
| 139 | + ) |
| 140 | + } |
| 141 | +} |
0 commit comments