Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle ver upgraded + create BuildTest.yml to export your APK using Github Actions #85

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .github/workflows/BuildTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Build and Test

on:

push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

workflow_dispatch:


jobs:

local_test_job:
name: Running Local Tests
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Print Java version
run: javac -version
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Touch local properties
run: touch local.properties
- name: Add Api Key
run: echo "apiKey=\"\"" >> local.properties

- name: Run Debug Tests
run: ./gradlew testDebugUnitTest --continue
- name: Upload Test Reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-reports
path: 'app/build/reports/tests/'

android_test_job:
name: Android Tests
runs-on: macos-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Print Java version
run: javac -version
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Touch local properties
run: touch local.properties
- name: Add Api Key
run: echo "apiKey=\"\"" >> local.properties

- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedAndroidTest

- name: Upload Android Test Reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: android-test-reports
path: 'app/build/reports/androidTests/'

build_job:
name: Building the APK
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Change wrapper permissions
run: chmod +x ./gradlew


- name: Touch local properties
run: touch local.properties
- name: Add Api Key
run: echo "apiKey=\"\"" >> local.properties

- name: Assemble Debug
run: ./gradlew assembleDebug

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: InfiniteCycleViewPagerAPK
path: app/build/outputs/apk/debug/**.apk
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 18 additions & 13 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.android.tools.build:gradle:4.2.2'
}
}

allprojects {
repositories {
jcenter()
google()
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip