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