Fix PRs not running Feature (#4304)

This commit is contained in:
Travis Plunk
2017-07-22 15:34:03 -07:00
committed by GitHub
parent c145866821
commit 0f34324570
2 changed files with 19 additions and 4 deletions
+3 -1
View File
@@ -87,7 +87,8 @@ function Add-UserToGroup
# or is a pushed tag
Function Test-DailyBuild
{
if(($env:PS_DAILY_BUILD -eq 'True') -or ($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') -or ($env:APPVEYOR_REPO_TAG_NAME))
$trueString = 'True'
if(($env:PS_DAILY_BUILD -eq $trueString) -or ($env:APPVEYOR_SCHEDULED_BUILD -eq $trueString) -or ($env:APPVEYOR_REPO_TAG_NAME))
{
return $true
}
@@ -96,6 +97,7 @@ Function Test-DailyBuild
# Run Daily tests
if($env:APPVEYOR_REPO_COMMIT_MESSAGE -match '\[feature\]')
{
Set-AppveyorBuildVariable -Name PS_DAILY_BUILD -Value $trueString
return $true
}
+16 -3
View File
@@ -97,17 +97,30 @@ function Set-DailyBuildBadge
# One of push, pull_request, api, cron.
$isPR = $env:TRAVIS_EVENT_TYPE -eq 'pull_request'
# For PRs, Travis-ci strips out [ and ] so read the message directly from git
if($env:TRAVIS_EVENT_TYPE -eq 'pull_request')
{
# Get the second log entry body
# The first log is a merge for a PR
$commitMessage = git log --format=%B -n 1 --skip=1
}
else
{
$commitMessage = $env:TRAVIS_COMMIT_MESSAGE
}
# Run a full build if the build was trigger via cron, api or the commit message contains `[Feature]`
$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' -or $env:TRAVIS_COMMIT_MESSAGE -match '\[feature\]'
$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' -or $commitMessage -match '\[feature\]'
if($Bootstrap.IsPresent)
{
Write-Host -Foreground Green "Executing travis.ps1 -BootStrap `$isPR='$isPr'"
Write-Host -Foreground Green "Executing travis.ps1 -BootStrap `$isPR='$isPr' - $commitMessage"
Start-PSBootstrap -Package:(-not $isPr)
}
else
{
Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild'"
Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild' - $commitMessage"
$output = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions))
# CrossGen'ed assemblies cause a hang to happen intermittently when running powershell class