close
The Wayback Machine - https://web.archive.org/web/20241006115842/https://www.geeksforgeeks.org/basic-ci-workflow-for-android-using-github-actions/
Open In App

Basic CI Workflow For Android using GitHub Actions

Last Updated : 06 Jun, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Continuous integration (CI) is a software development process in which the team members can integrate their work. For Android developers, setting up a CI pipeline can greatly enhance productivity and code quality. GitHub Actions, a powerful automation tool integrated into GitHub, provides an excellent platform for creating a CI workflow for Android projects. This article will guide you through the process of setting up a basic CI workflow for Android using GitHub Actions.

Prerequisites

Before we begin, make sure you have the following:

Steps to Implement

Step 1: Make a repository on Github and push any Android project into it. Since GitHub Actions checks for the CI workflows stored in a specific directory i.e. .github/workflows, we will create this directory in our GitHub repository. Once done with the above steps, click on Code -> Add a file -> Create new file.

BERJAYA

Step 2: CI scripts are written in a file called yaml (Yet Another Markup Language), having file extension .yml. So we’ll create a new directory as shown in the above step and add a .yml file to it. Name this file as test.yml. The path of the file will be now, .github/workflows/test.yml.

BERJAYA

Step 3: Now the main part of writing a script for the CI workflow comes in. Paste the code below into the file created in the previous step i.e. test.yml.

name: Android CI
on:
 push:
   branches: [master]
 pull_request:
   branches: [master]

jobs:
 build:
   runs-on: ubuntu-latest
   steps:
     – name: Checkout
       uses: actions/checkout@v2.4.0
     – name: Setup JDK
       uses: actions/setup-java@v2.5.0
       with:
         distribution: ‘temurin’
         java-version: ’11’
     – name: Set execution flag for gradlew
       run: chmod +x gradlew
     – name: Build with Gradle
       run: ./gradlew build

BERJAYA

Step 4: Scroll to the bottom. In the Commit New File section, give a Title and Description to the commit. Click on commit new file.

BERJAYA

Step 5: Now head to the Actions tab and you will see the workflow that you just created running there.

BERJAYA

Step 6: You can click on the Title of the workflow and see the detailed build. It will take a couple of minutes to run and after that, a green check stating that the run has succeeded will be shown.

BERJAYA


Previous Article
Next Article

Similar Reads

How to Upload Android APK to Testers Group in Firebase Using GitHub Actions?
Testing is always required whenever we build an app to ensure it functions properly in production. It might be time-consuming and inconvenient to send the application to the testers every time new code is merged into the codebase. So to solve this problem, CD pipelines can be used to deliver the software to the testers. In this article, we'll be le
3 min read
Automated Release for Android Using GitHub Actions
Automating the release process for Android applications can significantly enhance efficiency, reduce manual errors, and ensure consistent delivery. GitHub Actions provides a powerful platform to automate workflows directly from your GitHub repository. This article will guide you through setting up an automated release pipeline for Android using Git
3 min read
Github Actions For Android
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. CI/CD methodology provides speed, accuracy, and reliability. It increases the release rates by detecting the failures faster. Android is a widely used mobile operating system and developing apps
3 min read
Flutter - Building and Releasing APK using GitHub Actions
Github Actions is a Github tool that allows users to create CI/CD pipelines directly in a Github project instead of going to a third-party website. It assists us in developing, testing, and releasing our project very conveniently. In this article, we're going to build a workflow for our flutter project. We'll first build the project using the workf
3 min read
How to Publish Docker Image to Dockerhub Using Github Actions?
Pre-requisites: GitHub Actions, Docker Hub Publishing Docker images to Docker Hub using GitHub Actions is a simple and efficient process that can automate your image-building and publishing process. What are Github Actions?GitHub Actions is a CI/CD (Continuous Integration/Continuous Deployment) platform integrated with GitHub. It enables developers
3 min read
Spring Boot - Continuous Integration Using GitHub Actions
Let's say we have two or more developers who are merging code into a single repository. There can be issues in merging code from different developers. So the Continuous Integration tools help in solving not just that but many other things like: Run an automated build after successful merging (like build, test code coverage, etc.).We can also automa
3 min read
How to Set Up a CI Pipeline for Ktor Using GitHub Actions?
In this article, we'll look at how to use GitHub Actions to create a robust and effective Continuous Integration (CI) pipeline for Ktor applications. Developers have a great foundation to construct high-performance server-side apps thanks to Ktor, a versatile and lightweight Kotlin framework for building web applications. We can automate the build,
6 min read
Introduction to GitHub Actions
GitHub Actions is a CI/CD (Continuous Integration/ Continuous Deployment) platform for automating the builds, test, and deployment process. Using GitHub actions, we can build and test every pull request in the repository using workflows, or push the merged pull requests to production with workflows. GitHub Actions allows you to conduct processes in
4 min read
Deploy MERN Stack on AWS EC2 with Docker via GitHub Actions
EC2 stands for Elastic Cloud Computing and is a service that AWS offers for running applications, hosting websites, processing data, and performing other computing operations. How will we deploy our MERN application?We will push our MERN project frontend and backend into two different repositories on GitHub from our local machine. After that, using
15+ min read
How To Set Up Merge Queues in GitHub Actions?
Managing multiple pull requests (PRs) efficiently is important in a collaborative development environment. Merge queues help automate and control the merging of PRs in sequential order, ensuring that only PRs that pass all checks are merged into the main branch. In this article, we will discuss how to set up merge queues using GitHub Actions. Table
4 min read
The Matrix Strategy in GitHub Actions
GitHub Actions provides a platform for automating your CI/CD pipelines, allowing you to run workflows directly from your GitHub repositories. One of the most powerful features of GitHub Actions is the matrix strategy, which allows to run a single job in multiple configurations. This can include different operating systems, language versions, enviro
5 min read
REST API Endpoints For GitHub Actions Variables
GitHub Actions is used to automate workflows, build, test, and deploy code. To make workflows more dynamic and secure, GitHub Actions allows you to use variables, which can store data like configuration values, secrets, or other necessary information. GitHub exposes a REST API to manage these variables efficiently, providing developers with full co
5 min read
GitHub Actions
GitHub Actions is a powerful CI/CD (Continuous Integration/Continuous Deployment) tool integrated directly into GitHub. It allows developers to automate, customize, and execute workflows in their repositories. With GitHub Actions, you can automate software development processes, from testing and building to deployment and monitoring. In this articl
5 min read
How to Upload a Project through GitHub Desktop on GitHub
GitHub Desktop is a user-friendly application that simplifies the process of managing your GitHub repositories on your local machine. If you’re looking to upload a project to GitHub using GitHub Desktop, this guide will walk you through the steps, making the process straightforward and accessible even for beginners. What is GitHub Desktop?GitHub De
3 min read
How to Clone Android Project from GitHub in Android Studio?
Android Studio provides a platform where one can build apps for Android phones, tablets, Android Wear, Android TV, and Android Auto. Android Studio is the official IDE for Android application development, based on IntelliJ IDEA. One can develop Android Applications using Kotlin or Java as the Backend Language, and it provides XML for developing Fro
3 min read
What are Redux workflow features ?
Before going to the topic "Redux Workflow Features" we should look at the question "What is Redux?" What is Redux? "A Predictable State Container for JS Apps". In other words, Redux is a pattern-based library that is used to manage and update the application state. For managing and updating the application state Redux used events known as "action".
5 min read
Customizing Git Hooks for Workflow Automation
Git is a distributed version control system that monitors changes to a project. Git hooks are scripts that run in response to Git events such as commit or push. They automate tasks, enforce rules, and can be tailored to your project's requirements. A pre-commit hook, for example, can detect errors in the code, whereas a post-receive hook can send e
7 min read
Git Workflow Etiquettes
Version control systems like Git have revolutionized the way developers collaborate on projects. However, efficient collaboration depends on sticking to certain manners that streamline the workflow and ensure code quality. Here are some important Git workflow etiquettes to follow. Table of Content 1. Naming conventions for Branches2. Etiquettes for
2 min read
Forking Workflow in Open Source Ecosystem
In the Open Source ecosystem, Git and Github are widely used for efficiently managing large projects and collaborating with other developers worldwide. Hence a general Forking Workflow is followed by every developer who is contributing to these Open Source Projects. So let's deep dive to look at how exactly this Working by Forking works in an Open
3 min read
Why Every Team Needs a Git Workflow Strategy?
Git, the most popular version control system, offers powerful tools for managing code, tracking changes, and enabling collaboration across teams. However, the true power of Git can only be harnessed when teams adopt a clear and consistent Git workflow strategy. A Git workflow strategy outlines how team members should interact with the repository, m
7 min read
How to dispatch asynchronous actions using Redux Thunk?
Asynchronous actions are very important in web development, particularly in tasks such as fetching data from API. Redux Thunk is a middleware using which you can write action creators that return a function instead of an object. This function can perform asynchronous operations and dispatch actions to try and catch blocks. What is Redux Thunk?Redux
3 min read
Authenticate Using GitHub on Android
GitHub is where over 65 million developers shape the future of software, together. Contribute to the open-source community, manage your Git repositories, review code like a pro, track bugs and features, power your CI/CD and DevOps workflows, and secure code before you commit it. So in this article, we are going to discuss how to authenticate using
6 min read
How to Update User's Profile After Signing Through GitHub using Firebase in Android?
In this article, we will learn to update user's profiles who signed in to the app through GitHub. The profile will be updated through the user's GitHub information like GitHub Id, name, followers, following, etc. Let's start! Step 1: First set up your app so that users can be signed in through GitHub. So you need to authenticate the user using GitH
7 min read
How to Create a New Branch on GitHub using Android Studio?
Creating a new branch on GitHub using Android Studio can help your development workflow by allowing you to work on new features or fixes without affecting the main codebase. In this article, we will walk you through the steps to create a new branch directly from Android Studio and push it to your GitHub repository. Note: To Upload Project on GitHub
2 min read
How to Create a Pull Request on GitHub using Android Studio?
Creating a pull request is an important part of collaborating on projects hosted on GitHub. It allows you to propose changes to a repository, enabling others to review, discuss, and merge your changes. Here’s a step-by-step guide on how to create a pull request on GitHub using Android Studio. Steps to Create a Pull Request on GitHub using Android S
2 min read
Semantic-UI Comment Actions Content
Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing. In this article, we are going to learn about comment actions content. It is equipped with pre-built semantic components that help creat
2 min read
Semantic-UI Modal Actions Content
Semantic UI open-source framework gives icons or glyphs that are used to show pictures related to some elements using CSS and jQuery that is used to create great user interfaces. It is a development framework used to create beautiful and responsive layouts. Semantic UI Modal displays content above the screen that temporarily blocks interaction with
3 min read
Ember.js Controller actions Property
Ember.js is an open-source JavaScript framework used for developing large client-side web applications which is based on Model-View-Controller (MVC) architecture. Ember.js is one of the most widely used front-end application frameworks. It is made to speed up development and increase productivity. Currently, it is utilized by a large number of webs
3 min read
Ember.js Component actions Property
Ember.js is an open-source JavaScript framework used for developing large client-side web applications which are based on Model-View-Controller (MVC) architecture. Ember.js is one of the most widely used front-end application frameworks. It is made to speed up development and increase productivity. Currently, it is utilized by a large number of web
3 min read
How are actions defined in Redux ?
Redux is the state management library for JavaScript apps. It is used to manage the data globally in the app. In redux, there are three parts: Actions ReducerStoreActions: Actions are the JavaScript objects that have information. Actions provide information for the store. There is one more term that is used to create the action called Action creato
3 min read