GitHub Actions

Life before GitHub Actions

  1. Code Changes: Make your code changes locally on your development machine.

  2. Test Locally: Before committing any changes, ensure that your changes work locally by running tests and debugging.

  3. Commit Changes: Once you're confident in your changes, commit them to your local repository.

    git add . git commit -m "Description of changes"
  4. Push Changes to GitHub: Push your commits to your remote GitHub repository.

    git push origin branch-name

  5. Testing / APK process

  6. Build APK: Build your Android application APK either using Android Studio or Gradle from the command line.

    ./gradlew assembleReleaese

7. Manually Release: After the APK is built, manually upload or release it to the appropriate distribution platform, such as Google Play Console or any other distribution platform you're using.

8. Notify Stakeholders: Notify stakeholders / 20 Testers

9. Monitor Deployment: Keep track of the deployment process and address any issues that may arise during or after deployment.

10 downloads -> how many have crashes 

Monitor Google Play dashboard

CI / CD

CI: Continuous Integration

Manually build apk

./gradlew assembleDebug

 

Push -> GitHub Actions

-> on a VM (Linux , Windows, Mac)

-> Free for Public repos

Events

1. Code Push -> Actions - ./gradlew assembleDebug

2. pull request -> ./gradlew assebleDebug

3. Release events ./gradlew assebleDebug

4. Branch 

5. Wiki 

 

GitHub Actions MarketPlace

CI 

 

push -> ./gradlew assembleDebug -> Virtual Machine

 

1. GitHub's VM (RUNNERS)

2. Azure / AWS / GCP / own VM  (Runner)

GitHub Actions

1. Setting up VM using GitHub checkout v3

2. Install Java , SDK , run commands

3. Continuous Deployment?

APK -> Customer and link using

firebase, AWS, Google Play 

https://medium.com/@jovmit/ci-cd-for-android-initial-deployment-4b7f9eb021f0

HW:

 

1. How to run Unit Tests on GitHub actions

Using jacoco

 

./gradlew jacocoTestRepor

 

https://medium.com/@hhugoac/configuring-jacoco-for-testing-coverage-in-android-9bdad3dde705

Intrumented Test vs Unit Test

 

 

1. Intrumented : UI test 

2. Unit test-> test a function

 

function -> toTestPasswordSafe(){

if password Containes lowecase

if password upper case

}

function -> toTestPasswordSafe(){

if password Containes lowecase

if password upper case

}

 

testPassword("@Bc", false)

testPassword("@BC1a2312312", test)


name: {

CI

on: "value"
  push: "value
    branches: [ "main" ]
  pull_request: {
    branches: [ "main" ]

}

Runner?

cron -tab guru

GitHub Actions1. Free on public repos

By Harnoor Singh

GitHub Actions1. Free on public repos

  • 205