diff --git a/Jenkinsfile b/Jenkinsfile index 99eedba3..05cec737 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,70 +135,81 @@ node { ) } } - stage('Check') { - try { - timeout(time: 10, unit: 'MINUTES') { - buildInfo = rtGradle.run tasks: 'check', switches: gradleSwitches, buildInfo: buildInfo + try { + stage('Lint') { + try { + timeout(time: 5, unit: 'MINUTES') { + buildInfo = rtGradle.run tasks: 'lint', switches: "$gradleSwitches --continue".toString(), buildInfo: buildInfo + } + } finally { + publishHTML(target: [ + reportName: 'CodeNarc', + reportDir: 'build/reports/html/codenarc', + reportFiles: [ + 'exceptions', + 'main', + 'mainResources', + 'testFixtures', + 'test', + 'functionalTest', + 'compatTest', + 'buildSrc', + ].collect { "${ it }.html" }.join(', '), // TODO: read from directory ? + allowMissing: true, + keepAll: true, + alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID + ]) + } + } + } finally { + stage('Test') { + try { + timeout(time: 10, unit: 'MINUTES') { + buildInfo = rtGradle.run tasks: 'check', switches: gradleSwitches, buildInfo: buildInfo + } + } finally { + warnings( + consoleParsers: [ + [parserName: 'Java Compiler (javac)'], + [parserName: 'JavaDoc Tool'], + ] + ) + junit( + testResults: 'build/reports/xml/**/*.xml', + allowEmptyResults: true, + keepLongStdio: true, + ) + publishHTML(target: [ + reportName: 'Test', + reportDir: 'build/reports/html/test', + reportFiles: 'index.html', + allowMissing: true, + keepAll: true, + alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID + ]) + publishHTML(target: [ + reportName: 'FunctionalTest', + reportDir: 'build/reports/html/functionalTest', + reportFiles: 'index.html', + allowMissing: true, + keepAll: true, + alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID + ]) + publishHTML(target: [ + reportName: 'CompatTest', + reportDir: 'build/reports/html/compatTest', + reportFiles: + readFile(file: '.stutter/java8.lock', encoding: 'UTF-8') // TODO: respect other Java versions + .split('[\r\n]+') + // Copy of algorithm from StutterExtension.getLockedVersions + .findAll { !it.startsWith('#') } + .collect { "${ it.trim() }/index.html" } + .join(', '), + allowMissing: true, + keepAll: true, + alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID + ]) } - } finally { - warnings( - consoleParsers: [ - [parserName: 'Java Compiler (javac)'], - [parserName: 'JavaDoc Tool'], - ] - ) - publishHTML(target: [ - reportName: 'CodeNarc', - reportDir: 'build/reports/html/codenarc', - reportFiles: [ - 'exceptions', - 'main', - 'mainResources', - 'testFixtures', - 'test', - 'functionalTest', - 'compatTest', - 'buildSrc', - ].collect { "${ it }.html" }.join(', '), // TODO: read from directory ? - allowMissing: true, - keepAll: true, - alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID - ]) - junit( - testResults: 'build/reports/xml/**/*.xml', - allowEmptyResults: true, - keepLongStdio: true, - ) - publishHTML(target: [ - reportName: 'Test', - reportDir: 'build/reports/html/test', - reportFiles: 'index.html', - allowMissing: true, - keepAll: true, - alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID - ]) - publishHTML(target: [ - reportName: 'FunctionalTest', - reportDir: 'build/reports/html/functionalTest', - reportFiles: 'index.html', - allowMissing: true, - keepAll: true, - alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID - ]) - publishHTML(target: [ - reportName: 'CompatTest', - reportDir: 'build/reports/html/compatTest', - reportFiles: - readFile(file: '.stutter/java8.lock', encoding: 'UTF-8') // TODO: respect other Java versions - .split('[\r\n]+') - // Copy of algorithm from StutterExtension.getLockedVersions - .findAll { !it.startsWith('#') } - .collect { "${ it.trim() }/index.html" } - .join(', '), - allowMissing: true, - keepAll: true, - alwaysLinkToLastBuild: env.BRANCH_NAME == 'develop' && !env.CHANGE_ID - ]) } } stage('Release') {