forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PixarAnimationStudios#201 from autodesk-forks/adsk…
…/feature/pipeline_adsk Refine PR Build of adsk/dev
- Loading branch information
Showing
1 changed file
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ DEPLOY_CREDENTIALS = [$class: 'StringBinding', | |
// because of user input to a model window, path problems, etc. These need to be fixed. | ||
// timeout - to avoid potential test hangs, e.g. testUsdImagingGL without proper fixes | ||
// -R - a regular expression used to list desired tests rather than all tests (TBD) | ||
USDTESTINGFLAGS = "-E \"testUsdviewNavigationKeys|TfPathUtils\" --timeout 60" | ||
USDTESTINGFLAGS = "-E \"testUsdviewNavigationKeys\" --timeout 60" | ||
|
||
// Necessary flags to pass to build_usd.py | ||
USDBUILDINGFLAGS = "--materialx --ptex --openvdb --tests --build-args USD,\"-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF -DPXR_USE_PYTHON_3=ON\"" | ||
|
@@ -40,6 +40,13 @@ BUILD_LINUX = true | |
/////////////////////////////////////////////////// | ||
// Main program | ||
|
||
// The status on PR's target branch after it's merged is more important for us, | ||
// so exclude branch building, except a few branches for releasing purpose | ||
if (!(isDevBranch() || isReleaseBranch() || isPullRequest())) { | ||
echo "Skip CI for branches which are not dev, release branch or pull request." | ||
return | ||
} | ||
|
||
def jobParams = [ | ||
[$class: 'BooleanParameterDefinition', | ||
defaultValue: false, | ||
|
@@ -198,6 +205,18 @@ def checkoutGit() { | |
submoduleCfg: [], | ||
userRemoteConfigs: scm.userRemoteConfigs | ||
]) | ||
|
||
// Checkout target branch of PR and merge its' head to validate locally | ||
if (isPullRequest()) { | ||
COMMONSHELL.shell """\ | ||
git config user.name 'agpbuildguy' | ||
git config user.email '[email protected]' | ||
git checkout ${env.CHANGE_TARGET} | ||
git merge origin/${env.BRANCH_NAME} | ||
git submodule update --init --recursive | ||
git lfs pull origin | ||
""" | ||
} | ||
} | ||
|
||
def getBuildInfo(os, platform, config) { | ||
|
@@ -288,6 +307,13 @@ def isReleaseBranch(){ | |
return result | ||
} | ||
|
||
def isPullRequest(){ | ||
def match = env.BRANCH_NAME =~/(?i)^pr-.*/ | ||
def result = match ? true : false | ||
match = null | ||
return result | ||
} | ||
|
||
|
||
/////////////////////////////////////////////////// | ||
// Checkout functions | ||
|