Flutter CI - 2019
Flutter CI - 2019
Flutter CI - 2019
We are hiring!
Flutter app
code
Your app
Flutter Core
Embedder
Responsibility
Embedder App
Assets
Plugins
Embedder SDK
Platform code
CI steps
- Build app
- Run unit tests
- Run UI tests
- Run static analysis
- Code coverage
- Lint
- Danger
Difficulties of CI in mobile
development
- Android Emulator required for Instrumentation Tests
- iOS Simulator required for iOS UI Tests
- iOS apps can’t be build on linux
export PATH="$PATH:`pwd`/flutter/bin"
Let’s install flutter
What flutter doesn’t require
- Dart
- Flutter engine
- Java
- Android SDK *
- Xcode toolchain *
* Optional
Finally flutter is
installed
The flutter update
problem
Make your CI builds
reproducible!
Never use latest
before_script:
- ./flutterw doctor --verbose
pr:
script:
- ./ci/build_flutter.sh
Execute it on Jenkins
pipeline {
agent { docker "cirrusci/flutter"}
stages {
stage(“pr”) {
sh ‘ci/pr.sh’
}
}
}
Docker!
- Use Docker to build your flutter app
- Except for iOS builds
- Allows building it locally (gitlab-runner)
- Works on almost every modern CI
Improve our build_flutter.sh
#!/bin/bash
set -e
https://flutter.school