Last active
February 1, 2020 15:59
-
-
Save korinVR/25dcf74b8cc705b60dbcfb7d5b65aac2 to your computer and use it in GitHub Desktop.
Running Unity tests Jenkinsfile
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
def unity = 'C:\\Program Files\\Unity\\Hub\\Editor\\2019.3.0f6\\Editor\\Unity.exe' | |
pipeline { | |
agent any | |
triggers { | |
pollSCM('H/5 * * * *') | |
} | |
stages { | |
stage('Test') { | |
steps { | |
script { | |
try { | |
bat "\"${unity}\" -batchmode -runTests -testPlatform PlayMode -testResults TestResult-PlayMode.xml -logFile" | |
} catch (error) { | |
} | |
try { | |
bat "\"${unity}\" -batchmode -runTests -testPlatform EditMode -testResults TestResult-EditMode.xml -logFile" | |
} catch (error) { | |
} | |
} | |
} | |
} | |
} | |
post { | |
always { | |
nunit testResultsPattern: 'TestResult-PlayMode.xml,TestResult-EditMode.xml' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment