forked from jenkinsci/git-client-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
22 lines (19 loc) · 704 Bytes
/
Jenkinsfile
File metadata and controls
22 lines (19 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!groovy
buildPlugin(failFast: false)
// Return true if benchmarks should be run
// Benchmarks run if any of the most recent 3 commits includes the word 'benchmark'
boolean shouldRunBenchmarks(String branchName) {
// Disable benchmarks on default branch for speed
// if (branchName.endsWith('master') || branchName.endsWith('main')) { // accept either master or main
// return true;
// }
def recentCommitMessages
node('linux') {
checkout scm
recentCommitMessages = sh(script: 'git log -n 3', returnStdout: true)
}
return recentCommitMessages =~ /.*[Bb]enchmark.*/
}
if (shouldRunBenchmarks(env.BRANCH_NAME)) {
runBenchmarks('jmh-report.json')
}