Skip to content

Fix CI builds #14

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 2 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .vsts-ci/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ phases:
- powershell: |
tools/releaseBuild/vstsBuild.ps1 -Name $(buildName) -Verbose
displayName: Start build - $(buildName)
condition: succeededOrFailed()
condition: succeeded()
9 changes: 5 additions & 4 deletions .vsts-ci/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ phases:
steps:
- powershell: |
tools/releaseBuild/PowershellNative.ps1 -Arch osx -Configuration Release -RepoRoot $(Build.SourcesDirectory) -TargetLocation "$(System.ArtifactsDirectory)/Packages" -Verbose
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$(System.ArtifactsDirectory)/Packages/osx-symbols.zip"
$testResultPath = Get-ChildItem -Recurse -Filter 'native-tests.xml'
if($testResultPath -and (Test-Path $testResultPath)) { Write-Host "##vso[results.publish type=JUnit;mergeResults=true;runTitle=Native Test Results OSX;publishRunAttachments=true;resultFiles=$testResultPath;]"}
displayName: Start build
condition: succeededOrFailed()
condition: succeeded()
- powershell: |
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$(System.ArtifactsDirectory)/Packages/osx-symbols.zip"
displayName: Upload artifacts
condition: ne(variables['Build.Reason'], 'PullRequest')
12 changes: 8 additions & 4 deletions .vsts-ci/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ phases:
- powershell: |
choco install cmake.install --installargs 'ADD_CMAKE_TO_PATH=System'
displayName: Install cmake
condition: succeededOrFailed()
condition: succeeded()
- powershell: |
choco install windows-sdk-10.1
displayName: Install Windows SDK 10.1
Expand All @@ -39,13 +39,17 @@ phases:
Start-Process -FilePath 'vs_BuildTools.exe' -ArgumentList '--quiet', '--norestart', '--locale en-US', '--add Microsoft.VisualStudio.Component.VC.Tools.ARM', '--add Microsoft.VisualStudio.Component.VC.Tools.ARM64', '--includeRecommended', '--add Microsoft.VisualStudio.Workload.VCTools', '--add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop.arm', '--add Microsoft.VisualStudio.Component.VC.ATL', '--add Microsoft.VisualStudio.Component.VC.ATLMFC', '--add Microsoft.VisualStudio.Component.VC.ATL.ARM', '--add Microsoft.VisualStudio.Component.VC.ATL.ARM64' -Wait
Remove-Item .\vs_BuildTools.exe
Remove-Item -Force -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\Installer'
setx /M PATH $($Env:PATH + ';' + ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin')
$vsPath = ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin'
Write-Host "##vso[task.prependpath]$vsPath"
displayName: Install Visual Studio 2017
condition: succeeded()
- powershell: |
$cmakeBinPath = "$env:ProgramFiles\CMake\bin\"
if(Test-Path $cmakeBinPath) { $env:Path = "$cmakeBinPath;$env:PATH" } else { throw "CMake not installed under $cmakeBinPath" }
$(Build.SourcesDirectory)\tools\releaseBuild\PowerShellNative.ps1 -RepoRoot $(Build.SourcesDirectory) -TargetLocation "$(System.ArtifactsDirectory)\Packages" -Arch $(buildName) -Configuration Release -Symbols
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$(System.ArtifactsDirectory)\Packages\$(buildName)-symbols.zip"
displayName: Start build - $(buildName)
condition: succeeded()
condition: succeeded()
- powershell: |
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$(System.ArtifactsDirectory)\Packages\$(buildName)-symbols.zip"
displayName: Upload artifacts
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
39 changes: 23 additions & 16 deletions tools/releaseBuild/PowershellNative.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,47 @@ end {
Start-PSBootstrap
Start-BuildNativeUnixBinaries

$buildOutputPath = Join-Path $RepoRoot "src/powershell-unix"
Compress-Archive -Path $buildOutputPath/libpsl-native.* -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Verbose
if ($env:BUILD_REASON -ne 'PullRequest') {
$buildOutputPath = Join-Path $RepoRoot "src/powershell-unix"
Compress-Archive -Path $buildOutputPath/libpsl-native.* -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Verbose
} else {
Write-Verbose -Verbose "Skipping artifact upload since this is a PR."
}

$testResultPath = Join-Path $RepoRoot -ChildPath 'src/libpsl-native/test/native-tests.xml'

if (Test-Path $testResultPath) {
if ($Arch -eq 'linux-x64') {
$name = 'linux-x64-native-tests.xml'
}
else {
$name = 'osx-native-tests.xml'
}

Copy-Item $testResultPath -Destination "$TargetLocation/$name" -Verbose
Copy-Item $testResultPath -Destination $TargetLocation -Verbose -Force
}
}
elseif ($Arch -eq 'linux-arm') {
Start-PSBootstrap -BuildLinuxArm
Start-BuildNativeUnixBinaries -BuildLinuxArm

$buildOutputPath = Join-Path $RepoRoot "src/powershell-unix"
Compress-Archive -Path $buildOutputPath/libpsl-native.* -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Verbose
if ($env:BUILD_REASON -ne 'PullRequest') {
$buildOutputPath = Join-Path $RepoRoot "src/powershell-unix"
Compress-Archive -Path $buildOutputPath/libpsl-native.* -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Verbose
} else {
Write-Verbose -Verbose "Skipping artifact upload since this is a PR."
}

}
else {
Write-Verbose "Starting Start-PSBootstrap" -Verbose
Start-PSBootstrap -BuildWindowsNative
Write-Verbose "Starting Start-BuildNativeWindowsBinaries" -Verbose
Start-BuildNativeWindowsBinaries -Configuration $Configuration -Arch $Arch -Clean
Write-Verbose "Completed Start-BuildNativeWindowsBinaries" -Verbose
$buildOutputPath = Join-Path $RepoRoot "src/powershell-win-core"
Compress-Archive -Path "$buildOutputPath/*.dll" -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Verbose

if ($Symbols.IsPresent) {
Compress-Archive -Path "$buildOutputPath/*.pdb" -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Update -Verbose
if ($env:BUILD_REASON -ne 'PullRequest') {
$buildOutputPath = Join-Path $RepoRoot "src/powershell-win-core"
Compress-Archive -Path "$buildOutputPath/*.dll" -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Verbose

if ($Symbols.IsPresent) {
Compress-Archive -Path "$buildOutputPath/*.pdb" -DestinationPath "$TargetLocation/$Arch-symbols.zip" -Update -Verbose
}
} else {
Write-Verbose -Verbose "Skipping artifact upload since this is a PR."
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions tools/releaseBuild/vstsBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ end {
Write-VstsError -Error $_
}
finally {
$testResultPath = Get-ChildItem $env:AGENT_TEMPDIRECTORY -Recurse -Filter 'linux-x64-native-tests.xml'
$testResultPath = Get-ChildItem $env:AGENT_TEMPDIRECTORY -Recurse -Filter 'native-tests.xml'

if($testResultPath -and (Test-Path $testResultPath)) {
if ($testResultPath -and (Test-Path $testResultPath)) {
Write-Host "##vso[results.publish type=JUnit;mergeResults=true;runTitle=Native Test Results;publishRunAttachments=true;resultFiles=$testResultPath;]"
}
else {
Expand Down