From 284dae98e7f7d17328aa477cc1e7290d5f6d1cbb Mon Sep 17 00:00:00 2001 From: Mugunthan <87799495+Micoder-dev@users.noreply.github.com> Date: Thu, 14 Jul 2022 19:34:42 -0700 Subject: [PATCH 1/2] Create BuildTest.yml --- .github/workflows/BuildTest.yml | 104 ++++++++++++++++++++++++++++++++ 1 file changed, 104 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..8458841 --- /dev/null +++ b/.github/workflows/BuildTest.yml @@ -0,0 +1,104 @@ +name: Build and Test + +on: + 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: '**/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: '**/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: apk + path: app/build/outputs/apk/debug/**.apk From 3b9257e24ac9b7c562dfa3dd38dfb73892840e3b Mon Sep 17 00:00:00 2001 From: Mugunthan <87799495+Micoder-dev@users.noreply.github.com> Date: Thu, 14 Jul 2022 19:52:38 -0700 Subject: [PATCH 2/2] Update BuildTest.yml --- .github/workflows/BuildTest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildTest.yml b/.github/workflows/BuildTest.yml index 8458841..bbc539c 100644 --- a/.github/workflows/BuildTest.yml +++ b/.github/workflows/BuildTest.yml @@ -37,7 +37,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: test-reports - path: '**/build/reports/tests/' + path: 'app/build/reports/tests/' android_test_job: name: Android Tests @@ -74,7 +74,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: android-test-reports - path: '**/build/reports/androidTests/' + path: 'app/build/reports/androidTests/' build_job: name: Building the APK