From f542e10264bb8465ff6efd819bd4a5a9ffd5086f Mon Sep 17 00:00:00 2001 From: William Brawner Date: Fri, 29 Sep 2023 08:03:17 -0600 Subject: [PATCH] Update workflow to run unit and UI tests in parallel and execute on pull requests in addition to the main branch --- .github/workflows/android.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b139f72..5878033 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -1,14 +1,14 @@ name: Android CI on: + pull_request: push: branches: [ main ] jobs: build: - runs-on: ubuntu-latest - + name: Build steps: - uses: actions/checkout@v2 - name: set up JDK @@ -16,12 +16,28 @@ jobs: with: distribution: 'zulu' java-version: '17' - - name: Grant execute permission for gradlew - run: chmod +x gradlew + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 - name: Build with Gradle - run: ./gradlew assemblePlayDebug assemblePlayDebugAndroidTest + uses: gradle/gradle-build-action@v2 + with: + arguments: assemblePlayDebug assemblePlayDebugAndroidTest + unit_test: + name: Run Unit Tests + runs-on: ubuntu-latest + needs: + - build + steps: - name: Run unit tests - run: ./gradlew testPlayDebugUnitTest + uses: gradle/gradle-build-action@v2 + with: + arguments: testPlayDebugUnitTest + ui_tests: + runs-on: ubuntu-latest + name: Run UI Tests + needs: + - build + steps: - name: Grant execute permission for flank_auth.sh run: chmod +x flank_auth.sh - name: Add auth for flank @@ -30,4 +46,6 @@ jobs: run: | ./flank_auth.sh - name: Run UI tests - run: ./gradlew runFlank + uses: gradle/gradle-build-action@v2 + with: + arguments: runFlank