39
Introducing Continuous Integration for Android

Continues Integration for Android

  • Upload
    codete

  • View
    621

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Continues Integration for Android

Introducing

Continuous Integrationfor Android

Page 2: Continues Integration for Android

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

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

Benefits

Page 5: Continues Integration for Android

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

Drawbacks

Page 7: Continues Integration for Android

Initial setup overhead

A server is needed

Drawbacks

Page 8: Continues Integration for Android

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

Components

Page 10: Continues Integration for Android

Components

Page 11: Continues Integration for Android

Setup

Page 12: Continues Integration for Android

Setup (partial diagram)

Page 13: Continues Integration for Android

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

Jenkins

Page 15: Continues Integration for Android

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

Gradle

Page 17: Continues Integration for Android

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

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

Secure signing

Page 20: Continues Integration for Android

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

Testing

Page 22: Continues Integration for Android

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

Code quality analysis

Page 24: Continues Integration for Android

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

Team notification

Page 26: Continues Integration for Android

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

Distribution

Page 28: Continues Integration for Android

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

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

Setup

Page 31: Continues Integration for Android

Setup (full diagram)

Page 32: Continues Integration for Android

Jenkinsresponsibilities

Page 33: Continues Integration for Android

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

Gradleresponsibilities

Page 35: Continues Integration for Android

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

What's next?

Page 37: Continues Integration for Android

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

Thank you for your attention