2016-05-20 03:56:48 +00:00
|
|
|
version: 0.4.0.{build}
|
2016-03-15 20:22:47 +00:00
|
|
|
|
2016-05-20 03:56:48 +00:00
|
|
|
nuget:
|
|
|
|
project_feed: true
|
2016-03-12 02:24:43 +00:00
|
|
|
|
2016-01-22 19:36:23 +00:00
|
|
|
environment:
|
|
|
|
priv_key:
|
|
|
|
secure: <encryped-value>
|
|
|
|
|
2016-02-03 04:09:10 +00:00
|
|
|
notifications:
|
|
|
|
- provider: Slack
|
|
|
|
incoming_webhook:
|
|
|
|
secure: bwwXBTeJBtRFea6FSQKzVENLwL0AOeusUSUFIh/TeHA4y0UFk7bC9+OcxgZW+YfIC0VZyTpZClJHlPFFHSgiQs4g9om17RxzJEeq4EjsW5g=
|
|
|
|
|
2016-01-22 19:36:23 +00:00
|
|
|
install:
|
|
|
|
- ps: $fileContent = "-----BEGIN RSA PRIVATE KEY-----`n"
|
|
|
|
- ps: $fileContent += $env:priv_key.Replace(' ', "`n")
|
|
|
|
- ps: $fileContent += "`n-----END RSA PRIVATE KEY-----`n"
|
|
|
|
- ps: Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent
|
|
|
|
- git config --global url.git@github.com:.insteadOf https://github.com/
|
2016-04-02 02:15:41 +00:00
|
|
|
- git submodule update --init -- src/windows-build src/Modules/Pester
|
2016-05-18 20:58:59 +00:00
|
|
|
- ps: Import-Module .\build.psm1; Start-PSBootstrap
|
2016-01-22 19:36:23 +00:00
|
|
|
|
|
|
|
build_script:
|
2016-02-22 00:24:50 +00:00
|
|
|
- ps: |
|
2016-04-19 22:51:54 +00:00
|
|
|
$ErrorActionPreference = 'Stop'
|
2016-04-08 23:08:12 +00:00
|
|
|
Start-PSBuild -Publish
|
2016-03-12 00:19:05 +00:00
|
|
|
Start-PSBuild -FullCLR
|
2016-01-22 19:36:23 +00:00
|
|
|
|
|
|
|
test_script:
|
|
|
|
- ps: |
|
2016-02-10 21:16:22 +00:00
|
|
|
# fail tests execution, if any PS error detected
|
|
|
|
$ErrorActionPreference = 'Stop'
|
2016-02-26 07:48:06 +00:00
|
|
|
#
|
2016-02-04 01:29:27 +00:00
|
|
|
# CoreCLR
|
2016-05-11 20:51:07 +00:00
|
|
|
$env:CoreOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -Publish))
|
2016-03-12 02:24:43 +00:00
|
|
|
Write-Host -Foreground Green 'Run CoreCLR tests'
|
|
|
|
$testResultsFile = "$pwd\TestsResults.xml"
|
2016-05-11 23:55:12 +00:00
|
|
|
& ("$env:CoreOutput\powershell.exe") -noprofile -noninteractive -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile"
|
2016-01-22 19:36:23 +00:00
|
|
|
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
|
2016-02-04 01:29:27 +00:00
|
|
|
#
|
|
|
|
# FullCLR
|
2016-05-11 20:51:07 +00:00
|
|
|
$env:FullOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -FullCLR))
|
2016-03-12 02:24:43 +00:00
|
|
|
Write-Host -Foreground Green 'Run FullCLR tests'
|
|
|
|
$testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml"
|
2016-05-11 23:55:12 +00:00
|
|
|
Start-DevPSGitHub -binDir $env:FullOutput -NoNewWindow -ArgumentList '-noprofile', '-noninteractive', '-command', "Import-Module .\src\Modules\Pester; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR"
|
2016-03-12 02:24:43 +00:00
|
|
|
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFileFullCLR))
|
2016-02-26 07:48:06 +00:00
|
|
|
#
|
|
|
|
# Fail the build, if tests failed
|
2016-03-12 02:24:43 +00:00
|
|
|
Write-Host -Foreground Green 'Upload CoreCLR test results'
|
|
|
|
$x = [xml](cat -raw $testResultsFile)
|
2016-02-04 01:29:27 +00:00
|
|
|
if ([int]$x.'test-results'.failures -gt 0)
|
|
|
|
{
|
2016-03-12 02:24:43 +00:00
|
|
|
throw "$($x.'test-results'.failures) tests in test/powershell failed"
|
2016-02-04 01:29:27 +00:00
|
|
|
}
|
2016-03-12 02:24:43 +00:00
|
|
|
Write-Host -Foreground Green 'Upload FullCLR test results'
|
|
|
|
$x = [xml](cat -raw $testResultsFileFullCLR)
|
2016-02-26 07:48:06 +00:00
|
|
|
if ([int]$x.'test-results'.failures -gt 0)
|
|
|
|
{
|
2016-03-12 02:24:43 +00:00
|
|
|
throw "$($x.'test-results'.failures) tests in test/fullCLR failed"
|
2016-02-26 07:48:06 +00:00
|
|
|
}
|
2016-01-22 19:36:23 +00:00
|
|
|
|
2016-03-12 02:24:43 +00:00
|
|
|
|
2016-02-04 18:30:19 +00:00
|
|
|
on_finish:
|
2016-01-22 19:36:23 +00:00
|
|
|
- ps: |
|
2016-04-19 22:51:54 +00:00
|
|
|
$ErrorActionPreference = 'Stop'
|
2016-04-19 23:00:09 +00:00
|
|
|
try {
|
2016-05-24 21:49:03 +00:00
|
|
|
# Build package
|
|
|
|
$package = Start-PSPackage
|
2016-04-19 23:00:09 +00:00
|
|
|
# Creating project artifact
|
|
|
|
$name = git describe
|
|
|
|
$zipFilePath = Join-Path $pwd "$name.zip"
|
|
|
|
$zipFileFullPath = Join-Path $pwd "$name.FullCLR.zip"
|
|
|
|
Add-Type -assemblyname System.IO.Compression.FileSystem
|
|
|
|
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath)
|
|
|
|
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:FullOutput, $zipFileFullPath)
|
|
|
|
|
2016-05-20 02:03:43 +00:00
|
|
|
$artifacts = @(
|
2016-05-24 21:49:03 +00:00
|
|
|
$package,
|
2016-04-19 23:00:09 +00:00
|
|
|
$zipFilePath,
|
|
|
|
$zipFileFullPath
|
2016-05-20 02:03:43 +00:00
|
|
|
)
|
|
|
|
|
2016-05-22 07:43:36 +00:00
|
|
|
Publish-NuGetFeed -OutputPath .\nuget-artifacts -VersionSuffix "b$($env:APPVEYOR_BUILD_NUMBER)"
|
2016-05-20 02:03:43 +00:00
|
|
|
|
|
|
|
$artifacts += (ls .\nuget-artifacts | % {$_.FullName})
|
|
|
|
|
|
|
|
$artifacts | % {
|
|
|
|
Write-Host "Pushing $_ as Appveyor artifact"
|
2016-04-19 23:00:09 +00:00
|
|
|
Push-AppveyorArtifact $_
|
|
|
|
}
|
|
|
|
} catch {
|
|
|
|
Write-Host -Foreground Red $_
|
|
|
|
}
|