|
| 1 | +name: ChatApp |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - 'ChatApp/**' |
| 9 | + - '.github/workflows/chatapp.yaml' |
| 10 | + - '.github/ci-gradle.properties' |
| 11 | + pull_request: |
| 12 | + paths: |
| 13 | + - 'ChatApp/**' |
| 14 | + - '.github/workflows/chatapp.yaml' |
| 15 | + - '.github/ci-gradle.properties' |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: chatapp-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +jobs: |
| 23 | + chatapp-build: |
| 24 | + name: "ChatApp build & test" |
| 25 | + runs-on: macos-14 |
| 26 | + timeout-minutes: 45 |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: Copy CI gradle.properties |
| 33 | + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties |
| 34 | + |
| 35 | + - name: Set up JDK 21 |
| 36 | + uses: actions/setup-java@v4 |
| 37 | + with: |
| 38 | + distribution: 'zulu' |
| 39 | + java-version: 21 |
| 40 | + |
| 41 | + - name: Setup Gradle |
| 42 | + uses: gradle/actions/setup-gradle@v4 |
| 43 | + |
| 44 | + - name: Setup Android SDK |
| 45 | + uses: android-actions/setup-android@v4 |
| 46 | + |
| 47 | + - name: Run spotless |
| 48 | + run: ./gradlew spotlessCheck |
| 49 | + working-directory: ChatApp |
| 50 | + |
| 51 | + - name: Run unit tests |
| 52 | + run: ./gradlew test |
| 53 | + working-directory: ChatApp |
| 54 | + |
| 55 | + - name: Build Debug and Release APKs |
| 56 | + run: ./gradlew assembleDebug assembleRelease |
| 57 | + working-directory: ChatApp |
| 58 | + |
| 59 | + - name: Upload ChatApp APKs |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: chatapp-apks |
| 63 | + path: | |
| 64 | + ChatApp/app/build/outputs/apk/**/*.apk |
| 65 | + ChatApp/wear/build/outputs/apk/**/*.apk |
| 66 | +
|
| 67 | +# - name: Setup GMD |
| 68 | +# run: | |
| 69 | +# ./gradlew :app:pixel7Api35Setup \ |
| 70 | +# --info \ |
| 71 | +# -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true \ |
| 72 | +# -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" |
| 73 | +# working-directory: ChatApp |
| 74 | +# |
| 75 | +# - name: Run instrumentation tests |
| 76 | +# run: | |
| 77 | +# ./gradlew :app:pixel7Api35Check \ |
| 78 | +# -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true \ |
| 79 | +# -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" |
| 80 | +# working-directory: ChatApp |
| 81 | +# |
| 82 | +# - name: Setup WearOS GMD |
| 83 | +# run: | |
| 84 | +# ./gradlew :wear:wearOS34Setup \ |
| 85 | +# --info \ |
| 86 | +# -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true \ |
| 87 | +# -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" |
| 88 | +# working-directory: ChatApp |
| 89 | +# |
| 90 | +# - name: Run WearOS instrumentation tests |
| 91 | +# run: | |
| 92 | +# ./gradlew :wear:wearOS34Check \ |
| 93 | +# -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true \ |
| 94 | +# -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" |
| 95 | +# working-directory: ChatApp |
0 commit comments