Skip to content

Commit

Permalink
Modified logic to not build full on non-Windows
Browse files Browse the repository at this point in the history
Add additional verbose statements for debugging
  • Loading branch information
JamesWTruher committed Oct 18, 2018
1 parent e9c8175 commit 14e0fdc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 8 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ install:
build_script:
- ps: |
Set-Location $env:APPVEYOR_BUILD_FOLDER
./build.ps1 -Documentation
if ( $env:PSVersion -eq "4" ) { # On WMF4: Also build for v3 to check it builds at least since we do not have a WMF3 image
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion 3 -Framework full
if ( $env:PowerShellEdition -eq 'WindowsPowerShell' ) {
Set-Location $env:APPVEYOR_BUILD_FOLDER
./build.ps1 -Documentation
if ( $env:PSVersion -eq "4" ) { # On WMF4: Also build for v3 to check it builds at least since we do not have a WMF3 image
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion 3 -Framework full
}
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion "$env:PSVersion" -Framework full
}
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion "$env:PSVersion" -Framework full
- pwsh: |
if ($env:PowerShellEdition -eq 'PowerShellCore') {
Set-Location $env:APPVEYOR_BUILD_FOLDER
Expand All @@ -58,4 +60,4 @@ test_script:
# Upload the project along with test results as a zip archive
on_finish:
- ps: Import-Module "${env:BuildConfiguration}\tools\appveyor.psm1"; Invoke-AppveyorFinish
- ps: Import-Module "${env:APPVEYOR_BUILD_FOLDER}\tools\appveyor.psm1"; Invoke-AppveyorFinish
4 changes: 4 additions & 0 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ function Invoke-AppveyorTest {
$CheckoutPath
)

Write-Verbose -Verbose ("Running tests on PowerShell version " + $PSVersionTable.PSVersion)

$modulePath = $env:PSModulePath.Split([System.IO.Path]::PathSeparator) | Where-Object { Test-Path $_} | Select-Object -First 1
Copy-Item "${CheckoutPath}\out\PSScriptAnalyzer" "$modulePath\" -Recurse -Force
$testResultsFile = ".\TestResults.xml"
$testScripts = "${CheckoutPath}\Tests\Engine","${CheckoutPath}\Tests\Rules","${CheckoutPath}\Tests\Documentation"
$testResults = Invoke-Pester -Script $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
$assemblyLocation = (Get-Command Invoke-ScriptAnalyer).ImplementingType.Assembly.Location
Write-Verbose -Verbose "Engine loaded from $assemblyLocation"
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/${env:APPVEYOR_JOB_ID}", (Resolve-Path $testResultsFile))
if ($testResults.FailedCount -gt 0) {
throw "$($testResults.FailedCount) tests failed."
Expand Down

0 comments on commit 14e0fdc

Please sign in to comment.