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

Automate the Small Things - Chicago Roboto '19

Automate the Small Things - Chicago Roboto '19

Mobile moves fast, and so do you. To meet your deadlines, you want to build the right thing, at the right time; every time.

Your continuous integration pipeline allows you to do this, but can it do more?

- How can you enforce coding formatting, styling conventions, and best practices?
- Do you build everything on every commit? Do you have a daily build or customize your build per branch?
- What do you record and analyze? Are your tests passing? Is your apk getting too large?
- How do you distribute your apk for testing and release?

In this talk, you'll what tools are available at every step of the continuous integration pipeline; allowing you to automate as much as possible and dedicate your time to what matters most.

Nate Ebel

April 26, 2019
Tweet

More Decks by Nate Ebel

Other Decks in Programming

Transcript

  1. @n8ebel Automate the Small Things 1

  2. @n8ebel Why Automate? 2

  3. @n8ebel 3 Consistently build the right thing at the right

    time Why Automate?
  4. @n8ebel 4 Save time and energy for the real challenges

    Why Automate?
  5. @n8ebel 5 Make projects more approachable Why Automate?

  6. @n8ebel What to Automate? 6

  7. @n8ebel 7 All The Things!

  8. @n8ebel 8 QUALITY REVIEW DEPLOY BUILD

  9. @n8ebel Automated Build 9

  10. @n8ebel 10 BUILD BUILD Assemble Test Quality Deploy Educate

  11. @n8ebel 11 CONFIG BUILD ASSEMBLE TEST ETC

  12. @n8ebel 12 CircleCI Bitrise GCB Codemagic

  13. @n8ebel 13 CircleCI

  14. @n8ebel 14 CircleCI

  15. @n8ebel 15 CircleCI Add build config: .circleci/config.yml

  16. @n8ebel 16 CircleCI

  17. @n8ebel 17 CircleCI

  18. @n8ebel 18 CircleCI

  19. @n8ebel 19 CircleCI GitHub -> Settings -> Branches -> Branch

    Protection Rules -> AddRule
  20. @n8ebel 20 CircleCI

  21. @n8ebel 21 We Now Have An Automated Build

  22. @n8ebel Code Quality 22

  23. @n8ebel 23 ANDROID LINT CODE FORMATTING CODE SMELLS TESTS

  24. @n8ebel Enforcing Code Quality With Your Automated Build 24

  25. @n8ebel 25 BUILD CODE FORMATTING

  26. @n8ebel 26 BUILD CODE FORMATTING

  27. @n8ebel 27 BUILD CODE FORMATTING

  28. @n8ebel What’s The Problem Here? 28

  29. @n8ebel Locally Enforce Code Quality 29

  30. @n8ebel 30 CODE FORMATTING

  31. @n8ebel 31 “Git hooks are scripts that Git executes before

    or after events such as: commit, push, and receive.” CODE FORMATTING https://githooks.com/
  32. @n8ebel 32 CODE FORMATTING https://githooks.com/ PRE-PUSH CHECK FORMATTING

  33. @n8ebel 33 CODE FORMATTING https://proandroiddev.com/ooga-chaka-git-hooks-to-enforce-code-quali ty-11ce8d0d23cb

  34. @n8ebel 34 CODE FORMATTING .git/hooks/pre-push

  35. @n8ebel 35 CODE FORMATTING /scripts/git-hooks/pre-push.sh

  36. @n8ebel 36 CODE FORMATTING

  37. @n8ebel 37 Now We Can Prevent Pushes That Will Fail,

    And Share With The Team CODE FORMATTING
  38. @n8ebel Code Review 38

  39. @n8ebel 39 Validate Changes Discuss Approaches Learn

  40. @n8ebel PR Templates 40

  41. @n8ebel Want To Avoid 41

  42. @n8ebel Favor More Detail 42

  43. @n8ebel .github/pull_request_template.md 43 • Link to issue • Describe changes

    • Additional context • Checklists • Screenshots
  44. @n8ebel PR sections pre-populated 44

  45. @n8ebel Bonus Tip 45 Close issues via keyword • ‘Closes’

    • ‘Fixes’ • ‘Resolves’ • etc...
  46. @n8ebel Superpowered PRs With Danger 46

  47. @n8ebel “Danger runs during your CI process, and gives teams

    the chance to automate common code review chores.” 47
  48. @n8ebel 48 DANGER CHECK APK SIZE DEPENDENCY UPDATES INLINE LINT

    COMMENTS INFORMATIONAL MESSAGES ETC...
  49. @n8ebel • Need a Gemfile • Add `gem ‘danger’` •

    `bundle install` • `bundle exec danger init` 49
  50. @n8ebel 50

  51. @n8ebel 51

  52. @n8ebel 52

  53. @n8ebel 53

  54. @n8ebel 54

  55. @n8ebel 55

  56. @n8ebel 56

  57. @n8ebel 57 Bonus Tip

  58. @n8ebel And more… • Android Lint • String translations •

    Change in APK size • Test coverage • etc... 58
  59. @n8ebel Deployment 59

  60. @n8ebel • Daily build • Scheduled build • Triggered build

    • As needed 60
  61. @n8ebel 61 Merge to Develop Distribute Test Build Merge to

    Master Upload to Google Play
  62. @n8ebel 62 • Beta by Crashlytics

  63. @n8ebel 63

  64. @n8ebel 64 • Gradle Play Publisher

  65. @n8ebel 65

  66. @n8ebel 66 QUALITY REVIEW DEPLOY BUILD

  67. @n8ebel 67 Losing time, energy, or joy because of some

    task? … try automating it
  68. @n8ebel https://github.com/n8ebel/ChicagoRoboto19 68

  69. @n8ebel • https://proandroiddev.com/ooga-chaka-git-hooks-to-enforce-code-quality-11ce8d0d23cb • https://githooks.com/ • https://circleci.com/ • https://help.github.com/en/articles/creating-a-pull-request-template-for-your-repository •

    https://help.github.com/en/articles/closing-issues-using-keywords • https://danger.systems/ruby/ • https://danger.systems/guides/getting_started.html#including-danger • https://blog.bitrise.io/automating-code-review-tasks-for-multi-module-android-projects • https://github.com/Triple-T/gradle-play-publisher • https://try.crashlytics.com/beta/ • https://github.com/noboru-i/danger-checkstyle_format 69
  70. @n8ebel Thank You 70

  71. @n8ebel @n8ebel 71