diff --git a/Jenkinsfile b/Jenkinsfile index c61a67d..1717170 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,15 +15,15 @@ pipeline { } parameters { - string(name: 'BUILD_TYPE', value: 'all', description: 'Build type: all, android, web') - string(name: 'ANDROID_FLAVOR', value: 'release', description: 'Android build: debug, release') - string(name: 'VERSION_NAME', value: '', description: 'Override version name (optional)') - string(name: 'VERSION_CODE', value: '', description: 'Override version code (optional)') - booleanParam(name: 'CLEAN_BUILD', value: true, description: 'Run flutter clean before build') + string(name: 'BUILD_TYPE', defaultValue: 'all', description: 'Build type: all, android, web') + string(name: 'ANDROID_FLAVOR', defaultValue: 'release', description: 'Android build: debug, release') + string(name: 'VERSION_NAME', defaultValue: '', description: 'Override version name (optional)') + string(name: 'VERSION_CODE', defaultValue: '', description: 'Override version code (optional)') + booleanParam(name: 'CLEAN_BUILD', defaultValue: true, description: 'Run flutter clean before build') } triggers { - pollSCM('H 2 * * *') + cron('H 2 * * *') } stages { @@ -45,7 +45,7 @@ pipeline { stage('Environment Setup') { steps { script { - def flutterHome = tool name: 'Flutter', type: 'flutter' + def flutterHome = tool name: 'Flutter', type: 'Flutter' env.PATH = "${flutterHome}/bin:${env.PATH}" sh 'flutter doctor -v' } @@ -75,6 +75,16 @@ pipeline { } } + stage('Tests') { + steps { + sh 'flutter test --concurrency=1' + } + post { + always { + junit allowEmptyResults: true, testResults: '**/test-results/*.xml' + } + } + } stage('Build Android') { when {