CI: Migrated from Travis to Github Workflows CI (#1572)

This commit is contained in:
Rutvik Panchal 2020-11-28 22:36:36 +05:30 committed by GitHub
parent 7687408bf0
commit d9fd53cd59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 121 additions and 35 deletions

34
.github/workflows/feature_branch_ci.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Workflow for feature branches
on:
push:
branches:
- '*'
- '!development'
- '!master'
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v2
# Set up JDK
- name: Set Up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# Install NDK
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
# Update Gradle Permission
- name: Change gradlew Permission
run: chmod +x gradlew
# Build App
- name: Build with Gradle
run: ./gradlew assemble

75
.github/workflows/master_dev_ci.yml vendored Normal file
View File

@ -0,0 +1,75 @@
name: Workflow for master/development branches
on:
pull_request:
push:
branches:
- 'development'
- 'master'
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v2
# Set up JDK
- name: Set Up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# Install NDK
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
# Update Gradle Permission
- name: Change gradlew Permission
run: chmod +x gradlew
# Build App
- name: Build with Gradle
run: ./gradlew assemble
# Upload Built APK
- name: Upload Build Artifacts
uses: actions/upload-artifact@v2.2.0
with:
name: mifos-mobile
path: app/build/outputs/apk/debug/
lintCheck:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v2
- name: Static Analysis
run: ./gradlew lint
- name: Upload Static Analysis Report For Mifos-Mobile Module
uses: actions/upload-artifact@v2.2.0
if: failure()
with:
name: Static Analysis Report
path: app/build/reports/
pmd:
name: PMD
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v2
- name: PMD Check
run: ./gradlew pmd
- name: Upload PMD Report
uses: actions/upload-artifact@v2.2.0
if: failure()
with:
name: PMD Report
path: app/build/reports/

View File

@ -1,31 +0,0 @@
language: android
jdk: oraclejdk8
sudo: required
android:
components:
- tools
- extra-android-support
- extra-google-google_play_services
- extra-android-m2repository
- extra-google-m2repository
- build-tools-28.0.3
- android-28
- android-22
- sys-img-armeabi-v7a-android-22
before_script:
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script: "./gradlew build connectedAndroidTest --stacktrace"
# gitter integration
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/6c1aa14ed3a3ccb5bc92
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always

View File

@ -6,9 +6,9 @@ An Android Application built on top of the MifosX Self-Service platform for end-
### Status
[![Join the chat at https://gitter.im/openMF/self-service-app](https://badges.gitter.im/openMF/self-service-app.svg)](https://gitter.im/openMF/self-service-app?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/openMF/mifos-mobile.svg?branch=development)](https://travis-ci.org/openMF/mifos-mobile)
| Master | Development | Chat |
|------------|-----------------|-----------------|
| ![Mifos-Mobile CI[Master/Dev]](https://github.com/openMF/mifos-mobile/workflows/Mifos-Mobile%20CI%5BMaster/Dev%5D/badge.svg?branch=master) | ![Mifos-Mobile CI[Master/Dev]](https://github.com/openMF/mifos-mobile/workflows/Mifos-Mobile%20CI%5BMaster/Dev%5D/badge.svg?branch=development) |[![Join the chat at https://gitter.im/openMF/self-service-app](https://badges.gitter.im/openMF/self-service-app.svg)](https://gitter.im/openMF/self-service-app?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)|
## Screenshots
@ -29,7 +29,7 @@ We have the following branches :
* **development**
All the contributions should be pushed to this branch. If you're making a contribution,
you are supposed to make a pull request to _development_.
Please make sure it passes a build check on Travis.
Please make sure it passes a build check on Github Workflows CI.
It is advisable to clone only the development branch using the following command:
@ -42,6 +42,12 @@ We have the following branches :
* **master**
The master branch contains all the stable and bug-free working code. The development branch once complete will be merged with this branch.
To get the latest apk of master/development branch from Github Artifacts, follow these steps:
1. Go to to the [Actions](https://github.com/openMF/mifos-mobile/actions) tab of this repository.
2. Select the latest workflow for master/development branch.
3. Click on hyperlink 'mifos-mobile' in Artifacts section.
4. Extract the downloaded file and get the apk.
## Development Setup
Before you begin, you should have already downloaded the Android Studio SDK and set it up correctly. You can find a guide on how to do this here: [Setting up Android Studio](http://developer.android.com/sdk/installing/index.html?pkg=studio).

View File

@ -10,6 +10,7 @@ apply from: '../config/quality/quality.gradle'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
ndkVersion rootProject.ext.ndkVersion
defaultConfig {
applicationId "org.mifos.mobile"

View File

@ -36,6 +36,7 @@ ext {
targetSdkVersion = 28
compileSdkVersion = 28
buildToolsVersion = '28.0.3'
ndkVersion = '21.3.6528147'
// App dependencies
supportLibraryVersion = '1.0.0'