From 768fdd76aa13095e90dc3395ee56c3add9ecfc0a Mon Sep 17 00:00:00 2001 From: Mugunthan Date: Wed, 10 Aug 2022 01:12:26 +0530 Subject: [PATCH 1/3] Create BuildTest.yml --- .github/workflows/BuildTest.yml | 111 ++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 .github/workflows/BuildTest.yml diff --git a/.github/workflows/BuildTest.yml b/.github/workflows/BuildTest.yml new file mode 100644 index 0000000..222e70e --- /dev/null +++ b/.github/workflows/BuildTest.yml @@ -0,0 +1,111 @@ +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: 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: 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: Assemble Debug + run: ./gradlew assembleDebug + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: InfiniteCycleViewPagerAPK + path: app/build/outputs/apk/debug/**.apk From 217d9d65fec425a1a07230fd4143a53a5f7c147f Mon Sep 17 00:00:00 2001 From: Micoder-dev Date: Wed, 10 Aug 2022 01:27:54 +0530 Subject: [PATCH 2/3] gradle versions updated for building with latest android studio 2021.2.1 chipmunk --- .idea/.name | 1 - .idea/compiler.xml | 18 +------------- .idea/gradle.xml | 12 +++------ .idea/misc.xml | 31 ++++++++++++++---------- .idea/modules.xml | 13 +++++++--- build.gradle | 4 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- 7 files changed, 35 insertions(+), 46 deletions(-) delete mode 100644 .idea/.name diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 4a61183..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -icvp \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..fb7f4a8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,22 +1,6 @@ - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 0312fac..cf1a672 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -3,9 +3,10 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index d5124e1..4e9f5b2 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,36 +5,41 @@ - - - - - - - - - - - + diff --git a/.idea/modules.xml b/.idea/modules.xml index a1f689f..c65cc42 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,10 +2,15 @@ - - - - + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5f66515..0294706 100644 --- a/build.gradle +++ b/build.gradle @@ -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() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4228fe..79ff5d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 From 738249019cf7b2f3cf07682a0f7f4dc41ff87afa Mon Sep 17 00:00:00 2001 From: Mugunthan Date: Wed, 10 Aug 2022 01:33:09 +0530 Subject: [PATCH 3/3] local.properties error solved for Github Actions --- .github/workflows/BuildTest.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/BuildTest.yml b/.github/workflows/BuildTest.yml index 222e70e..14f6a83 100644 --- a/.github/workflows/BuildTest.yml +++ b/.github/workflows/BuildTest.yml @@ -36,6 +36,11 @@ jobs: 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 @@ -70,6 +75,12 @@ jobs: 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: @@ -101,6 +112,13 @@ jobs: ${{ 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