From 1ef52cd11e9023921a2016056216cc950de0f911 Mon Sep 17 00:00:00 2001 From: Mugunthan Date: Mon, 22 Aug 2022 14:37:49 +0530 Subject: [PATCH 1/5] Create BuildTest.yml --- .github/workflows/BuildTest.yml | 129 ++++++++++++++++++++++++++++++++ 1 file changed, 129 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..d046342 --- /dev/null +++ b/.github/workflows/BuildTest.yml @@ -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: FoldingCellAPK + path: app/build/outputs/apk/debug/**.apk From 4eccec42be84ec3bdcc8aaf2fb64af36ae8fa6ed Mon Sep 17 00:00:00 2001 From: Mugunthan Date: Mon, 22 Aug 2022 14:42:07 +0530 Subject: [PATCH 2/5] Update BuildTest.yml --- .github/workflows/BuildTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/BuildTest.yml b/.github/workflows/BuildTest.yml index d046342..09e3dc5 100644 --- a/.github/workflows/BuildTest.yml +++ b/.github/workflows/BuildTest.yml @@ -126,4 +126,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: FoldingCellAPK - path: app/build/outputs/apk/debug/**.apk + path: folding-cell/build/outputs/apk/debug/**.apk From 4bb00b39ea0ca22390385bfe5be97b81a76d7516 Mon Sep 17 00:00:00 2001 From: Mugunthan Date: Mon, 22 Aug 2022 14:45:32 +0530 Subject: [PATCH 3/5] 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 09e3dc5..5dc07c9 100644 --- a/.github/workflows/BuildTest.yml +++ b/.github/workflows/BuildTest.yml @@ -49,7 +49,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: test-reports - path: 'app/build/reports/tests/' + path: 'folding-cell-listview-example/build/reports/tests/' android_test_job: name: Android Tests @@ -126,4 +126,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: FoldingCellAPK - path: folding-cell/build/outputs/apk/debug/**.apk + path: folding-cell-listview-example/build/outputs/apk/debug/**.apk From 56927ae7d2ba16d414dd4221c570981dd57a2da5 Mon Sep 17 00:00:00 2001 From: Mugunthan Date: Mon, 22 Aug 2022 14:54:51 +0530 Subject: [PATCH 4/5] Update BuildTest.yml --- .github/workflows/BuildTest.yml | 82 --------------------------------- 1 file changed, 82 deletions(-) diff --git a/.github/workflows/BuildTest.yml b/.github/workflows/BuildTest.yml index 5dc07c9..3a2e67b 100644 --- a/.github/workflows/BuildTest.yml +++ b/.github/workflows/BuildTest.yml @@ -12,88 +12,6 @@ on: 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: 'folding-cell-listview-example/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 From fc30027c459dd36cb5cee0b1706842eefc7ca8f2 Mon Sep 17 00:00:00 2001 From: Mugunthan Date: Wed, 21 Sep 2022 10:31:24 +0530 Subject: [PATCH 5/5] Rename BuildTest.yml to build.yml --- .github/workflows/{BuildTest.yml => build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{BuildTest.yml => build.yml} (100%) diff --git a/.github/workflows/BuildTest.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/BuildTest.yml rename to .github/workflows/build.yml