Files
PowerShell/appveyor.yml
T

83 lines
3.5 KiB
YAML
Raw Normal View History

2016-03-15 13:22:47 -07:00
image: Visual Studio 2015
2016-03-11 18:24:43 -08:00
version: 0.2.0.{build}
2016-01-22 11:36:23 -08:00
environment:
priv_key:
secure: <encryped-value>
notifications:
- provider: Slack
incoming_webhook:
secure: bwwXBTeJBtRFea6FSQKzVENLwL0AOeusUSUFIh/TeHA4y0UFk7bC9+OcxgZW+YfIC0VZyTpZClJHlPFFHSgiQs4g9om17RxzJEeq4EjsW5g=
2016-01-22 11:36:23 -08: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-01 19:15:41 -07:00
- git submodule update --init -- src/windows-build src/Modules/Pester
- ps: Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.ps1 -OutFile install.ps1
2016-04-01 16:52:14 -07:00
- ps: ./install.ps1 -version 1.0.0-beta-002198
2016-01-22 11:36:23 -08:00
build_script:
2016-02-21 16:24:50 -08:00
- ps: |
2016-03-21 14:20:26 -07:00
$env:Path += ";$env:LocalAppData\Microsoft\dotnet\cli"
2016-03-09 14:26:19 -08:00
dotnet --version
2016-02-21 16:24:50 -08:00
Import-Module .\PowerShellGitHubDev.psm1
Start-PSBuild
Start-PSBuild -FullCLR
2016-01-22 11:36:23 -08:00
test_script:
- ps: |
# fail tests execution, if any PS error detected
$ErrorActionPreference = 'Stop'
#
2016-02-03 17:29:27 -08:00
# CoreCLR
2016-04-01 21:01:10 -07:00
$env:CoreOutput = "$pwd\src\Microsoft.PowerShell.Host\bin\Debug\netstandardapp1.5\win81-x64"
2016-03-11 18:24:43 -08:00
Write-Host -Foreground Green 'Run CoreCLR tests'
$testResultsFile = "$pwd\TestsResults.xml"
2016-04-01 21:01:10 -07:00
& ("$env:CoreOutput\powershell.exe") -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile"
2016-01-22 11:36:23 -08:00
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
2016-02-03 17:29:27 -08:00
#
# FullCLR
$env:FullOutput = "$pwd\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451"
2016-03-11 18:24:43 -08:00
Write-Host -Foreground Green 'Run FullCLR tests'
$testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml"
2016-04-01 21:01:10 -07:00
Start-DevPSGitHub -binDir $env:FullOutput -NoNewWindow -ArgumentList '-command', "Import-Module .\src\Modules\Pester; Import-Module .\bin\Modules\Microsoft.PowerShell.Platform; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR"
2016-03-11 18:24:43 -08:00
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFileFullCLR))
#
# Fail the build, if tests failed
2016-03-11 18:24:43 -08:00
Write-Host -Foreground Green 'Upload CoreCLR test results'
$x = [xml](cat -raw $testResultsFile)
if ([int]$x.'test-results'.failures -gt 0)
{
throw "$($x.'test-results'.failures) tests in test/powershell failed"
}
2016-03-11 18:24:43 -08:00
Write-Host -Foreground Green 'Upload FullCLR test results'
$x = [xml](cat -raw $testResultsFileFullCLR)
if ([int]$x.'test-results'.failures -gt 0)
{
throw "$($x.'test-results'.failures) tests in test/fullCLR failed"
}
2016-01-22 11:36:23 -08:00
2016-02-04 10:30:19 -08:00
on_finish:
2016-01-22 11:36:23 -08:00
- ps: |
# Creating project artifact
2016-03-11 18:24:43 -08:00
$name = git describe
$zipFilePath = Join-Path $pwd "$name.zip"
$zipFileFullPath = Join-Path $pwd "$name.FullCLR.zip"
2016-01-22 11:36:23 -08:00
Add-Type -assemblyname System.IO.Compression.FileSystem
2016-04-01 21:01:10 -07:00
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath)
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:FullOutput, $zipFileFullPath)
2016-01-22 11:36:23 -08:00
@(
# You can add other artifacts here
2016-02-02 16:11:05 -08:00
$zipFilePath,
$zipFileFullPath
2016-01-22 11:36:23 -08:00
) | % {
Write-Host "Pushing package $_ as Appveyor artifact"
Push-AppveyorArtifact $_
}