Skip to content

Instantly share code, notes, and snippets.

@sudhanshu-15
Created November 14, 2018 15:59
Show Gist options
  • Save sudhanshu-15/582cb90567306b6e5b56b90688f2e2d7 to your computer and use it in GitHub Desktop.
Save sudhanshu-15/582cb90567306b6e5b56b90688f2e2d7 to your computer and use it in GitHub Desktop.
Jenkins file for Flutter tests
pipeline {
agent any
stages {
stage ('Checkout') {
steps {
checkout scm
}
}
stage ('Download lcov converter') {
steps {
sh "curl -O https://raw.githubusercontent.com/eriwen/lcov-to-cobertura-xml/master/lcov_cobertura/lcov_cobertura.py"
}
}
stage ('Flutter Doctor') {
steps {
sh "flutter doctor"
}
}
stage('Test') {
steps {
sh "flutter test --coverage"
}
post {
always {
sh "python3 lcov_cobertura.py coverage/lcov.info --output coverage/coverage.xml"
step([$class: 'CoberturaPublisher', coberturaReportFile: 'coverage/coverage.xml'])
}
}
}
stage('Run Analyzer') {
steps {
sh "dartanalyzer --options analysis_options.yaml ."
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment