Skip to content

Commit e10bca5

Browse files
committed
Fix logs on build failure
1 parent d6132a1 commit e10bca5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

extension/BuildPhpExtension/private/Invoke-Build.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ Function Invoke-Build {
4040
) -join "-")
4141
& $builder -c $Config.vs_version -a $Config.Arch -s $Config.vs_toolset -t $task | Tee-Object -FilePath "build-$suffix.txt"
4242
Set-GAGroup end
43+
if(-not(Test-Path "$((Get-Location).Path)\$($Config.build_directory)\php_$($Config.name).dll")) {
44+
throw "Failed to build the extension"
45+
}
4346
Add-BuildLog tick $Config.name "Extension $($Config.name) built successfully"
4447
} catch {
45-
Add-BuildLog cross $Config.name "Failed to build"
48+
Add-BuildLog cross $Config.name "Failed to build the extension"
4649
throw
4750
}
4851
}

extension/BuildPhpExtension/private/Invoke-Tests.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Function Invoke-Tests {
1313
begin {
1414
}
1515
process {
16+
Add-StepLog "Running tests for $($Config.name) extension"
1617
try {
1718
$currentDirectory = (Get-Location).Path
1819
$php_dir = Join-Path $currentDirectory php-bin
@@ -34,9 +35,6 @@ Function Invoke-Tests {
3435
$type='zend_extension'
3536
}
3637
$extensionPath = "$currentDirectory\$($Config.build_directory)\php_$($Config.name).dll"
37-
if(-not(Test-Path $extensionPath)) {
38-
throw "Extension was not built successfully. Cannot run tests."
39-
}
4038
$php_args = @(
4139
"-n",
4240
"-d $type=$extensionPath"

0 commit comments

Comments
 (0)