This repo demonstrates how to work on CI/CD for Mobile Apps πŸ“± using Github Actions πŸ’Š + Firebase Distribution πŸŽ‰

Overview

Android-CICD

This repo demonstrates how to work on CI/CD for Mobile Apps πŸ“± using Github Actions πŸ’Š + Firebase Distribution πŸŽ‰

Getting Started

We are here setup a continious integration pipelines using Github Actions and a continious delivery using Firebase Distribution ⚑ ⚑

If you want to know a brief definition for the two terms CI/CD πŸ™†β€β™‚οΈ , Checkout out the quotes :

  • Continuous Integration

    Is the practice of merging all developers' working copies to a shared mainline several times a day.

  • Continuous Delivery

    Is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time and, when releasing the software, without doing so manually.

CI/CD

Workflows

  • πŸš€ pre_check.yaml : This workflow have to check for lint, testing and static code analyzer
  • πŸš€ build.yaml : This workflow have to build and deploy to firebase distribution

Getting Started With CI ⚑

To get start with build CI pipelines, you should use Actions tab or create a new YAML file, then you could setup your workflow, please checkout Metadata syntax for GitHub Actions 🧐

How to create your own workflow

  1. name

Name of your workflow

  1. on

Control when the workflow will be triggerd

  1. jobs

Deterimne one or more jobs / pipelines to run for the workflow, but you have to specifiy some parameters to run the job

  • job_name

Pick up your own job name

  • runs_on

Specify your runner type

  • steps

Represent a squence of tasks will be exceuted for each job / pipeline, each step have a some of parameters

  • uses

One of step parameters, you can use it when your are trying to install enviornment or repository from marketplace

  • run

One of step parameters, you can use it when your are trying to hit a command

CI Sample πŸ₯³

This workflow run as a lint checker for each Pushing on master branch πŸš€

name: Build lint checker report

on:
  push:
    branches: [ master ]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps: 
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Java JDK
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Build Lint
        run: ./gradlew lintDebug
    
      - name: Upload Build Lint Report
        uses: actions/upload-artifact@v2
        with:
          name: report
          path: app/build/reports/lint-results-debug.html
  • Checkout : This action checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
  • Setup Java JDK
  • Build Lint : Run lint report
  • Upload Build Lint Report : This uploads artifacts from your workflow allowing you to share data between jobs and store data once a workflow is complete.

Getting Started With CD ⚑

To get start with build CD pipelines, you should integrate your app with Firebase Distribution, then you could setup your workflow, please checkout Firebase Distribution for more how to integrate your app with firebase 🧐

Firebase App Distribution makes distributing your apps to trusted testers painless. By getting your apps onto testers' devices quickly, you can get feedback early and often.

CD Sample πŸ₯³

This workflow builds a debug APK, then upload the artifact APK to a workflow dashboard and send another one to testers group on firebase distributions dashboard after each Pull Request on master branch πŸš€

name: Integrate Firebase Distributions + Github Actions

on:
  pull_request_target:
    branches: [ master ]

jobs:
  builds:
    runs-on: ubuntu-latest
    steps: 
      - name: Checkout
        uses: actions/checkout@v2
        
      - name: Setup Java JDK
        uses: actions/setup-java@v1
        with:
         java-version: 1.8
        
      - name: Build Gradle
        run: ./gradlew build
    
      - name: Upload a Build Artifact
        uses: actions/upload-artifact@v2
        with:
          name: app
          path: app/build/outputs/apk/debug/app-debug.apk
          
      - name: Upload Artifact To Firebase App Distribution
        uses: wzieba/[email protected]
        with:
          appId: ${{ secrets.FIREBASE_ID }}
          token: ${{ secrets.FIREBASE_TOKEN }}
          groups: Android-CICD-Testers
          releaseNotes: "Hey! This my first integrate Firebase distributions with Github Actions"
          file: app/build/outputs/apk/debug/app-debug.apk   
  • Build Gradle : Build your APK.
  • Upload Artifact To Firebase App Distribution : This action uploads artifacts (.apk,.aab) to Firebase App Distribution.
  • appId : Get it from your project settings on firebase console.
  • token : Run this command firebase login:ci, for more informations about how to get your firbase token, check out Firebase CLI

Secrets : This path to encrypt your sensitive information, you can access it from Settings/Secrets Tab, for more info checkout out Encrypted Secrets

Screenshot from firebase distribution dashboard after sending the debug_app using Actions workflow

Release

Contributing

Don't hesitate to contribute with any updates or improves, just fork this repository, make the change you'd like and then submit a pull request.

Issues

Notice any issues with a repository? Please file a Github Issue in this repository.

License

The MIT License (MIT)

Copyright (c) 2021 MohamedGElsharkawy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
You might also like...
Open-source telematics app for Android. The application is suitable for UBI (Usage-based insurance), shared mobility, transportation, safe driving, tracking, family trackers, drive-coach, and other driving mobile applications
Open-source telematics app for Android. The application is suitable for UBI (Usage-based insurance), shared mobility, transportation, safe driving, tracking, family trackers, drive-coach, and other driving mobile applications

TelematicsApp-Android with FirebaseΒ© integration Description This Telematics App is created by DATA MOTION PTE. LTD. and is distributed free of charge

 Non-official Library Genesis (Libgen) Android mobile client.
Non-official Library Genesis (Libgen) Android mobile client.

Aurora If my noble work has helped you, consider becoming a . This is a non-official Library Genesis mobile client. The project is completely independ

Basic example of using ItemTouchHelper to add drag & drop and swipe-to-dismiss to RecyclerView.

Another drag and swipe library? This project is an example of basic drag & drop and swipe-to-dismiss with RecyclerView using ItemTouchHelper. It corre

πŸ“š  Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.
πŸ“š Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Components Architecture in a Modular Word Android Components Architecture in a Modular Word is a sample project that presents modern, 2020 app

This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Android L preview example Description This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shad

Create curve bottom navigation using this library
Create curve bottom navigation using this library

Curve Bottom Bar Download Add it to your build.gradle with: allprojects { repositories { maven { url "https://jitpack.io" } } } and: d

This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Android L preview example Description This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shad

Demo app to showcase Sensor data using AIDL bound services.
Demo app to showcase Sensor data using AIDL bound services.

AIDLServices Displays data related to TYPE_ROTATION_VECTOR sensor using AIDL Consist of aidlsdk module that expose sensor data Sample app to show the

A sample app showing how to build an app using the MVI architecture pattern.
A sample app showing how to build an app using the MVI architecture pattern.

MVI Example This application was streamed live on Twitch to demonstrate how to build an application using MVI. You can find the VOD here for now: http

Owner
Mohamed Elsharkawy
Android Developer
Mohamed Elsharkawy
A simple app demonstrates using Jetpack compose with other Jetpack libraries.

Android Pokemon Compose This repository is a simple app that make request to https://pokeapi.co and display them in the paginated lists. It demonstrat

BenBoonya 56 May 21, 2022
This repository demonstrates handling unauthorized tokens.

Android - sample handling unauthorized tokens This repository demonstrates handling unauthorized tokens. Refresh the access token using the refresh to

Kenji Abe 7 Jul 10, 2021
An example that demonstrates how to integrate a learning app with the EIDU platform

EIDU Sample Learning App This app is an example of how to create a learning app that integrates with the EIDU platform. Please consult dev.eidu.com fo

null 0 Dec 17, 2021
Quality-Tools-for-Android 7.5 0.0 L5 Java This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform.

Quality Tools for Android This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android pl

StΓ©phane Nicolas 1.3k Dec 27, 2022
This repo contains example code for O'Reilly's "Programming Android" by Zigured Mednieks, Laird Dornin, Blake Meike and Masumi Nakamura

This repo contains working code for the example in O'Reilly's _Programming Android, 2nd Edition_; Mednieks, Dornin, Meike, Nakamura (http://shop.orei

G. Blake Meike 214 Nov 25, 2022
This repo contains example code for O'Reilly's "Programming Android" by Zigured Mednieks, Laird Dornin, Blake Meike and Masumi Nakamura

This repo contains working code for the example in O'Reilly's _Programming Android, 2nd Edition_; Mednieks, Dornin, Meike, Nakamura (http://shop.orei

G. Blake Meike 165 Nov 11, 2022
This repo is to document my learning about Custom views in android

Custom-Views This repo is to document my learning about Custom views in android Note: If you are trying to understand Custom views, go in order: Custo

Kshitij Kumar 7 Feb 24, 2022
A demonstration modern Android development project with Jetpack(Compose, Room, Flow, ViewModel, Navigation), Hilt and based on MVVM by using Github API.

A demonstration modern Android development project with Jetpack(Compose, Room, ViewModel, Navigation), Hilt and based on MVVM by using Github API.

Murat 2 Apr 11, 2022
Playground Android project to test jacoco-report github action

jacoco-android-playground Playground Android project to test jacoco-report github action Running Code Coverage at Module level The app module has mult

Saravana 18 Dec 20, 2022
The official CovPass(-Check) Android apps and SDK.

android-covpass-app This repo contains the CovPass app and commonly needed modules for Kotlin + Android. The most important modules are: android-utils

null 181 Dec 8, 2022