diff --git a/appveyor.yml b/appveyor.yml index 1c5185a60..4c211c2b1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,9 +38,13 @@ test_script: $ErrorActionPreference = 'Stop' # # CoreCLR - $env:CoreOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -Publish -Configuration $buildConfiguratio)) + $env:CoreOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -Publish -Configuration $buildConfiguration)) Write-Host -Foreground Green 'Run CoreCLR tests' $testResultsFile = "$pwd\TestsResults.xml" + if(!(Test-Path "$env:CoreOutput\powershell.exe")) + { + throw "CoreCL PowerShell.exe was not built" + } & ("$env:CoreOutput\powershell.exe") -noprofile -noninteractive -c "Set-ExecutionPolicy -Scope Process Unrestricted; Invoke-Pester test/powershell -Tag 'CI' -ExcludeTag 'Slow' -OutputFormat NUnitXml -OutputFile $testResultsFile" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) @@ -111,10 +115,23 @@ on_finish: $artifacts += (ls .\nuget-artifacts | % {$_.FullName}) + $pushedAllArtifacts = $true $artifacts | % { Write-Host "Pushing $_ as Appveyor artifact" - Push-AppveyorArtifact $_ + if(Test-Path $_) + { + Push-AppveyorArtifact $_ + } + else + { + $pushedAllArtifacts = $false + Write-Warning "Artifact $_ does not exist." + } } + if(!$pushedAllArtifacts) + { + throw "Some artifacts did not exist!" + } } catch { Write-Host -Foreground Red $_ }