continues integration for android
TRANSCRIPT
![Page 1: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/1.jpg)
Introducing
Continuous Integrationfor Android
![Page 2: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/2.jpg)
Is it worth it?
What's inside - unboxing
Who (and how) is pulling the strings
What can we automate
Summary
Agenda
![Page 3: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/3.jpg)
Is it worth it?
What's inside - unboxing
Who (and how) is pulling the strings
What can we automate
Summary
Agenda
![Page 4: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/4.jpg)
Benefits
![Page 5: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/5.jpg)
Time is saved and responsibilities are delegated
- less management and oversight, more regularity
Signing credentials safety
On-a-plate project's health statistics
Immediate information sharing among team's members
- success/failure, health
Benefits
![Page 6: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/6.jpg)
Drawbacks
![Page 7: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/7.jpg)
Initial setup overhead
A server is needed
Drawbacks
![Page 8: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/8.jpg)
Is it worth it?
What's inside - unboxing
Who (and how) is pulling the strings
What can we automate
Summary
Agenda
![Page 9: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/9.jpg)
Components
![Page 10: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/10.jpg)
Components
![Page 11: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/11.jpg)
Setup
![Page 12: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/12.jpg)
Setup (partial diagram)
![Page 13: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/13.jpg)
Is it worth it?
What's inside - unboxing
Who (and how) is pulling the strings
What can we automate
Summary
Agenda
![Page 14: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/14.jpg)
Jenkins
![Page 15: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/15.jpg)
Well known (has many plugins and good support)
For each project there is one or more jobs
A job's execution is called a build
So called build steps allow to chain multiple actions
A finished build can trigger another job
Each job starts a new emulator instance
Jenkins - key facts
![Page 16: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/16.jpg)
Gradle
![Page 17: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/17.jpg)
Currently recommended build tool for Android
Highly flexible, very powerful
Transparent configuration format
Unified building process across machines
Dependencies resolved efficiently
Executes so called tasks, e.g. 'assemble', 'test',
'connectedCheck'
Gradle - key facts
![Page 18: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/18.jpg)
Is it worth it?
What's inside - unboxing
Who (and how) is pulling the strings
What can we automate
Summary
Agenda
![Page 19: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/19.jpg)
Secure signing
![Page 20: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/20.jpg)
Well known (has many plugins and good support)
For each project there is one or more jobs
A job's execution is called a build
So called build steps allow to chain multiple actions
A finished build can trigger another job
Each job starts a new emulator instance
Secure signing
Requirements:each public build should be signedsigning keys for release builds should be kept safe
Secure signing
Solution:keep release keys only on the CI serverconfigure Gradle to use release keys if available(server case)otherwise make it use debug keys(dev's computer case)
![Page 21: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/21.jpg)
Testing
![Page 22: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/22.jpg)
Tests' types:unit testsUI tests on an emulator
Testing
Automation gains:verify codebase frequently to discover new bugs rapidlyrun all tests periodically to ensure full regression compliance
![Page 23: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/23.jpg)
Code quality analysis
![Page 24: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/24.jpg)
Automation gains:verify codebase frequently to discover new bugs rapidlyrun all tests periodically to ensure full regression compliance
Prevents bugs introduction
Improves future development's speed
Encourages good practices
Automatic inspections save developers' time
High-quality code makes developers happy
Code quality analysis
![Page 25: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/25.jpg)
Team notification
![Page 26: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/26.jpg)
Push messages to a Slack channel of choice
Post a job status change
E-mail notifications are also available but…
people tend to ignore those (or mark them as spam)
Team notification
![Page 27: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/27.jpg)
Distribution
![Page 28: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/28.jpg)
Easy APK sharing via Crashlytics (e.g. for QA teams)
Dedicated jobs use only special commits
(e.g. with a release tag)
Distribution
![Page 29: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/29.jpg)
Is it worth it?
What's inside - unboxing
Who (and how) is pulling the strings
What can we automate
Summary
Agenda
![Page 30: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/30.jpg)
Setup
![Page 31: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/31.jpg)
Setup (full diagram)
![Page 32: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/32.jpg)
Jenkinsresponsibilities
![Page 33: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/33.jpg)
Fetches the code
Starts an emulator
Starts code analysis (Sonar Runner)
Invokes Gradle (!)
Collects and publishes artifacts and results
- APKs
- reports: lint, tests
Pushes notifications to Slack
Jenkins - responsibilities
![Page 34: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/34.jpg)
Gradleresponsibilities
![Page 35: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/35.jpg)
Builds the app (APK)
Signs the app
Performs Android-specific analysis (lint)
Performs unit tests
Performs UI tests
Gradle - responsibilities
![Page 36: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/36.jpg)
What's next?
![Page 37: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/37.jpg)
Other frameworks for UI tests
- Espresso, Android Testing Support Library
Other tools for continuous integration
- Team City
Direct APKs' upload to Google Play
Running tests on multiple emulators
Customized Slack notifications
What's next?
![Page 38: Continues Integration for Android](https://reader033.vdocument.in/reader033/viewer/2022051709/587897631a28ab375f8b6d13/html5/thumbnails/38.jpg)
Thank you for your attention