From a74b7c4aaa6d2a7893e51179e73a65992299972f Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 13:47:42 -0700 Subject: [PATCH 1/8] Create appveyor.yml --- appveyor.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..9617f85b4 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,47 @@ +# WS2012R2 image with April WMF5.0 +os: unstable + +# Install Pester +install: + - cinst -y pester + +# Build PSScriptAnalyzer using msbuild +build: true + +# branches to build +branches: + # whitelist + only: + - master + - bugfixes + - development + +# Run Pester tests and store the results +test_script: + - SET PATH=c:\Program Files\WindowsPowerShell\Modules\;%PATH%; + - ps: | + copy "C:\projects\psscriptanalyzer\PSScriptAnalyzer" "$Env:ProgramFiles\WindowsPowerShell\Modules\" -Recurse -Force + $engineTestResultsFile = ".\EngineTestResults.xml" + $ruleTestResultsFile = ".\RuleTestResults.xml" + $engineTestResults = Invoke-Pester -Script "C:\projects\psscriptanalyzer\Tests\Engine" -OutputFormat NUnitXml -OutputFile $engineTestResultsFile -PassThru + (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $engineTestResultsFile)) + if ($engineTestResults.FailedCount -gt 0) { + throw "$($engineTestResults.FailedCount) tests failed." + } + $ruleTestResults = Invoke-Pester -Script "C:\projects\psscriptanalyzer\Tests\Rules" -OutputFormat NUnitXml -OutputFile $ruleTestResultsFile -PassThru + (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $ruleTestResultsFile)) + if ($ruleTestResults.FailedCount -gt 0) { + throw "$($ruleTestResults.FailedCount) tests failed." + } + +# Upload the project along with TestResults as a zip archive +on_finish: + - ps: | + $stagingDirectory = (Resolve-Path ..).Path + $zipFile = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip" + Add-Type -assemblyname System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFile) + @( + # You can add other artifacts here + (ls $zipFile) + ) | % { Push-AppveyorArtifact $_.FullName } From 400fd78543e64ad2daa53b9d8489de6070a5eb8b Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 13:56:21 -0700 Subject: [PATCH 2/8] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1708364fc..69376225a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ +Build Status +------------ + +| |Master Branch | +|---------|:------:|:------:|:-------:|:-------:| +|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/raghushantha/psscriptanalyzer-pfrhl/branch/master) | + + Introduction ============ From 8a6e030c77e7d9c593056b6b1cdc8e4e83b0d7bd Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 13:57:50 -0700 Subject: [PATCH 3/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 69376225a..16bf11b62 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Build Status | |Master Branch | |---------|:------:|:------:|:-------:|:-------:| -|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/raghushantha/psscriptanalyzer-pfrhl/branch/master) | +|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/powershell/psscriptanalyzer-pfrhl/branch/master) | Introduction From 2260344d30e6a4f54cf44a94f42c41c8a05f5366 Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 14:06:04 -0700 Subject: [PATCH 4/8] Update appveyor.yml --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 9617f85b4..28eb6cfa6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,9 @@ # WS2012R2 image with April WMF5.0 os: unstable +# clone directory +clone_folder: c:\projects\psscriptanalyzer + # Install Pester install: - cinst -y pester From b83765edd1267dce662bcbf5c92766cdfc36a3e7 Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 14:17:13 -0700 Subject: [PATCH 5/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 16bf11b62..41a828dc7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Build Status | |Master Branch | |---------|:------:|:------:|:-------:|:-------:| -|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/powershell/psscriptanalyzer-pfrhl/branch/master) | +|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/powershell/psscriptanalyzer/branch/master) | Introduction From 0a6fef29f45354cfe80a67ca652183a2d474af18 Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 15:04:16 -0700 Subject: [PATCH 6/8] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 41a828dc7..c12d79e11 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,4 @@ -Build Status ------------- - -| |Master Branch | -|---------|:------:|:------:|:-------:|:-------:| -|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/powershell/psscriptanalyzer/branch/master) | - - Introduction ============ @@ -78,6 +70,14 @@ Throughput Graph [![Throughput Graph](https://graphs.waffle.io/powershell/psscriptanalyzer/throughput.svg)](https://waffle.io/powershell/psscriptanalyzer/metrics) +Build Status +------------ + +| |Master Branch | +|---------|:------:|:------:|:-------:|:-------:| +|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/powershell/psscriptanalyzer/branch/master) | + + Contributing to ScriptAnalyzer ============================== From c347cb7e45b6762515d1da7fd94d523e1bcfd37b Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 15:18:18 -0700 Subject: [PATCH 7/8] Update README.md --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c12d79e11..5acabe8bc 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,19 @@ To confirm installation: run ```Get-ScriptAnalyzerRule``` in the PowerShell cons Building the Code ================= -Use Visual Studio to build "ScriptAnalyzer.sln". Use ~/PSScriptAnalyzer/ folder to load PSScriptAnalyzer.psd1 +Use Visual Studio to build "PSScriptAnalyzer.sln". Use ~/PSScriptAnalyzer/ folder to load PSScriptAnalyzer.psd1 **Note: If there are any build errors, please refer to Requirements section and make sure all dependencies are properly installed** + +Build Status +============== + +| |Master Branch | +|---------|:------:|:------:|:-------:|:-------:| +|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/h5mot3vqtvxw5d7l?svg=true)](https://ci.appveyor.com/project/PowerShell/psscriptanalyzer) | + + Running Tests ============= @@ -70,13 +79,6 @@ Throughput Graph [![Throughput Graph](https://graphs.waffle.io/powershell/psscriptanalyzer/throughput.svg)](https://waffle.io/powershell/psscriptanalyzer/metrics) -Build Status ------------- - -| |Master Branch | -|---------|:------:|:------:|:-------:|:-------:| -|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/6anth3x81y6bd5dr/branch/master?svg=true)](https://ci.appveyor.com/project/powershell/psscriptanalyzer/branch/master) | - Contributing to ScriptAnalyzer ============================== From 478206d25d20f71ef7bb20c82dd18f8ad48d05b1 Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 14 May 2015 15:44:44 -0700 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5acabe8bc..25d4aea1a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Build Status | |Master Branch | |---------|:------:|:------:|:-------:|:-------:| -|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/h5mot3vqtvxw5d7l?svg=true)](https://ci.appveyor.com/project/PowerShell/psscriptanalyzer) | +|**Debug Version**|[![Build status](https://ci.appveyor.com/api/projects/status/h5mot3vqtvxw5d7l/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/psscriptanalyzer/branch/master) | Running Tests