From 706048344f54f2c3a7f80fa1c3dbcdfe04db26b4 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Fri, 22 Jan 2016 11:36:23 -0800 Subject: [PATCH] Add AppVeyor CI integration. AppVeyor is a cloud-based CI platform for windows. Use [skip ci] tag in any place of message to mark commit as trivial (i.e. README.md changes). --- README.md | 6 ++++++ appveyor.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 appveyor.yml diff --git a/README.md b/README.md index 5c68678f8..1c632af6e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # PowerShell on Linux / OS X / Windows +| |Ubuntu 14.04 |Windows | +|---------|:------:|:------:| +|master| TODO |[![Build status](https://ci.appveyor.com/api/projects/status/wb0a0apbn4aiccp1/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/powershell-linux/branch/master)| +|appveyor| |[![Build status](https://ci.appveyor.com/api/projects/status/wb0a0apbn4aiccp1/branch/appveyor?svg=true)](https://ci.appveyor.com/project/PowerShell/powershell-linux/branch/appveyor)| + + ## Obtain the source code ### Setup Git diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..d20b8a04c --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,40 @@ +environment: + priv_key: + secure: + +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/ + - git submodule update --init --recursive -- src/monad src/windows-build test/Pester + - ps: Invoke-WebRequest -Uri https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/dotnet-win-x64.latest.zip -OutFile dotnet.zip + - 7z x dotnet.zip -odotnet > nul + +build_script: + - ps: Set-Alias -Name dotnet -Value "$pwd\dotnet\bin\dotnet.exe" + - ps: dotnet restore + - ps: .\build.ps1 + +test_script: + - ps: | + $testResultsFile = ".\TestsResults.xml" + .\bin\powershell.exe -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile" + (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) + + +deploy_script: + - ps: | + # Creating project artifact + $zipFilePath = Join-Path $pwd "$(Split-Path $pwd -Leaf).zip" + Add-Type -assemblyname System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::CreateFromDirectory("$pwd\bin", $zipFilePath) + + @( + # You can add other artifacts here + $zipFilePath + ) | % { + Write-Host "Pushing package $_ as Appveyor artifact" + Push-AppveyorArtifact $_ + }