Skip to content

Commit

Permalink
Merge pull request PixarAnimationStudios#201 from autodesk-forks/adsk…
Browse files Browse the repository at this point in the history
…/feature/pipeline_adsk

Refine PR Build of adsk/dev
  • Loading branch information
zhangha182 authored and GitHub Enterprise committed Jan 4, 2023
2 parents 42a834f + 42e9455 commit 925d419
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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\""
Expand All @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 925d419

Please sign in to comment.