Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CI for Android: why and how to do it?

CI for Android: why and how to do it?

Avatar for Andrii Chubko

Andrii Chubko

July 29, 2021
Tweet

More Decks by Andrii Chubko

Other Decks in Programming

Transcript

  1. Plan 1. What is CI (Continuous Integration) and what do

    we need it for 2. How to choose a CI solution 3. How to set up your first CI system 4. Optimizing CI 3
  2. ▪ Endless discussions about the “right” code style ▪ “Dead”

    tests that are created but not run ▪ Manually building and sending APKs to QAs ▪ Access keys are “safely” scattered across computers and notes ▪ Manually updating info on all the services you use – Jira, Github, Play Store etc. 6 Problems that CI solves Setting up CI Optimizing CI 01. WHAT IS CI Choosing CI
  3. ▪ Processes automation – saving time and effort ▪ Early

    problem detection ▪ Confidence in code and product quality ▪ Easier to release and do it more frequently 9 Benefits of CI Setting up CI Optimizing CI 01. WHAT IS CI Choosing CI
  4. ▪ Setting up and supporting CI takes time ▪ Additional

    waiting time for CI checks to run 10 CI drawbacks Setting up CI Optimizing CI 01. WHAT IS CI Choosing CI
  5. ▪ Hosted vs On-premises ▪ Compatibility with the services you’re

    using ▪ Cost ▪ Support and popularity 11 Choosing a CI solution: what to consider? What is CI Setting up CI Optimizing CI 02. CHOOSING CI
  6. ✅ Flexible ✅ Large ecosystem (open source) ❌ Difficult to

    support, takes a lot of time and effort ❌ Painful to use 12 Jenkins What is CI Setting up CI Optimizing CI 02. CHOOSING CI
  7. ✅ Flexible ✅ Large ecosystem (open source) ❌ Difficult to

    support, takes a lot of time and effort ❌ Painful to use 13 Jenkins What is CI Setting up CI Optimizing CI 02. CHOOSING CI
  8. ✅ Easy to set up ✅ Lots of pricing plans,

    free ones available ❌ Dependency on the service provider 14 What is CI Setting up CI Optimizing CI 02. CHOOSING CI
  9. ▪ Fastlane – simplified release configuration (beta, public), launching tests

    and gathering results ▪ Gradle Play Publisher – publishing to Google Play 15 Additional tools What is CI Setting up CI Optimizing CI 02. CHOOSING CI
  10. CI workflow – a combination of scenarios that define the

    order of executing tasks. 16 Creating a workflow: what is it? What is CI Optimizing CI 03. Setting up CI Choosing CI
  11. ▪ Git workflow – types of branches, commit messages format

    ▪ Which tests to run and when ▪ Delivering the app for QA / release ▪ What data needs to be sent to QAs / users 17 Creating a workflow: what to consider? What is CI Optimizing CI 03. Setting up CI Choosing CI
  12. 19 Setting up a workflow with CircleCI What is CI

    Optimizing CI 03. Setting up CI Choosing CI
  13. 20 Configuring Android environment config.yml – YAML format What is

    CI Optimizing CI 03. Setting up CI Choosing CI
  14. 24 Job in our config file Job in our CI

    tool What is CI Optimizing CI 03. Setting up CI Choosing CI
  15. 27 Workflow in a config file Workflow in our CI

    tool What is CI Optimizing CI 03. Setting up CI Choosing CI
  16. ▪ Execution time ▪ Resources used ▪ Cost 29 CI:

    what are we optimizing? 04. OPTIMIZING CI What is CI Choosing CI Setting up CI
  17. ▪ Purchasing a pricing plan with more resources ▪ Parallelization

    ▪ Optimizing memory settings in Gradle ▪ Caching ▪ Building APKs instead of bundles (for non-Google Play releases) ▪ Building specific Android build variants (for example, using buildDebugProd instead of buildDebug) 30 Examples of CI optimizations 04. OPTIMIZING CI What is CI Choosing CI Setting up CI
  18. ▪ Config file used in the presentation ▪ CircleCI page

    of the project used in presentation ▪ Theoretical articles from Atlassian ▪ CircleCI for Android - official docs ▪ Caching using multiple files with CircleCI ▪ Settings up Firebase Test Lab with CircleCI ▪ Advanced example of CircleCI config ▪ Overview of various Git flows and their connection to CI Additional resources 36