#android #open-source

10 Useful Github Actions For CI/CD Android

Published Nov 1, 2024 by Adi Andrea


GitHub Actions has revolutionized the way developers automate their workflows, including continuous integration (CI) and continuous delivery (CD) pipelines. For Android developers, leveraging GitHub Actions can significantly streamline the development process, ensuring code quality, consistency, and efficient deployment.

In this article, we’ll explore 10 useful GitHub Actions specifically designed to enhance your Android CI/CD pipeline. These actions will help you automate tasks such as building, testing, linting, and deploying your Android apps, ultimately saving you time and effort.

1. Setup Java SDK

The GitHub action Setup Java SDK is a tool that allows you to set up a specific version of the Java JDK for your GitHub Actions workflows. It supports a variety of Java distributions, including Eclipse Temurin, Azul Zulu OpenJDK, AdoptOpenJDK, and more. You can also choose the specific version of Java you need, as well as the architecture and packaging type.

2. Gradle Build Action

This GitHub action is used to configure Gradle for GitHub Actions workflows. It can be used to configure Gradle on any platform supported by GitHub Actions. The example usage is shown in the document.

3. Ktlint With Reviewdog

This Actions allows you to run ktlint with reviewdog on pull requests to enforce best practices. It is designed to help you improve the quality of your Kotlin code by automatically checking it for formatting and style issues. Once installed, the action will run ktlint on every pull request and report any errors or warnings to the pull request conversation.

4. Android Emulator Runner

This GitHub Action is designed to install, configure, and run Android emulators within your GitHub Actions workflows. It leverages hardware acceleration, making it significantly faster than the older ARM-based emulators. However, hardware acceleration has some requirements, including graphics acceleration and VM acceleration. VM acceleration can be particularly challenging in CI environments due to nested virtualization limitations. Fortunately, public GitHub repositories can benefit from hardware-accelerated emulators on GitHub’s larger Linux runners.

5. Android Test Report

This is a GitHub action that prints Android test reports summarized from the given url. It allows you to print test results in a structured way. To use this action, you must first add it to your GitHub Actions workflow. Then, once the test command has been executed, the Android Test Report action will parse all of the XML reports and output the results. You can also choose to run the Android Test Report action regardless of whether the unit test job passes or fails.

6. Sign Android Release

Used to sign Android release APK or AAB files. Signing your app is a crucial step in the release process, as it helps to verify the authenticity and integrity of your app. This action simplifies the signing process by allowing you to automate it within your GitHub Actions workflows.

7. Create Github Release

Allows users to upload release assets, create external release notes, and customize the release name.

8. Upload Build Artifact

Allows users to upload build artifacts that can be used by subsequent workflow steps. Once installed, the action can be used to upload a variety of files, including individual files, entire directories, and files that match a wildcard pattern. Additionally, the action can be used to upload multiple paths and exclusions, and to alter the compression level of the uploaded files.

9. Upload Android Release To Play Store

This GitHub action allows you to upload signed Android releases (.apk or .aab) to the Google Play Store Developer Console summarized from the given url. It discusses the different inputs and outputs that are required for the action to work. Some of the important points are that you need a service account json file to authorize the upload request, and that you can specify the track in which you want to assign the uploaded app.

10. Slack Integration

GitHub Action that integrates with Slack summarized from the given url. It allows users to send notifications to Slack about the status of their GitHub Actions workflows, jobs, and steps. Users can customize the messages that are sent to Slack.

With the right combination of actions, you can streamline your Android development process and focus on building exceptional apps. Start leveraging these tools today to experience the benefits of automated CI/CD for your Android projects.



*****

© 2024, Adi Andrea | Pudhina Fresh theme for Jekyll.