summaryrefslogtreecommitdiff
path: root/.github/workflows/android.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/android.yml')
-rw-r--r--.github/workflows/android.yml69
1 files changed, 4 insertions, 65 deletions
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index aa292f2..e99bf7d 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -2,9 +2,9 @@ name: Android CI/CD
on:
push:
- branches: [ master ]
+ branches: [ main, claude/** ]
pull_request:
- branches: [ master ]
+ branches: [ main ]
jobs:
build:
@@ -24,17 +24,11 @@ jobs:
run: chmod +x android-app/gradlew
- name: Build with Gradle
- run: ./gradlew assembleDebug assembleDebugAndroidTest
+ run: ./gradlew assembleDebug
working-directory: android-app
- - name: Upload artifact
- uses: actions/upload-artifact@v4
- with:
- name: app-debug
- path: android-app/app/build/outputs/apk/debug/app-debug.apk
-
- name: upload artifact to Firebase App Distribution
- if: github.ref == 'refs/heads/master'
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_APP_ID}}
@@ -63,58 +57,3 @@ jobs:
-H "X-Hub-Signature-256: sha256=${SIG}" \
"${CLAUDOMATOR_WEBHOOK_URL}/api/webhooks/github" \
-d "$PAYLOAD"
-
- smoke-test:
- runs-on: ubuntu-latest
- # Run after build succeeds so we don't spin up an emulator for a broken build
- needs: build
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'temurin'
- cache: gradle
-
- - name: Grant execute permission for gradlew
- run: chmod +x android-app/gradlew
-
- - name: Enable KVM (faster emulator)
- run: |
- echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
- sudo udevadm control --reload-rules
- sudo udevadm trigger --name-match=kvm
-
- - name: Run smoke tests on emulator
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: 30
- arch: x86_64
- profile: pixel_3a
- script: ./gradlew connectedDebugAndroidTest
- working-directory: android-app
-
- - name: Notify claudomator
- if: always()
- env:
- CLAUDOMATOR_WEBHOOK_URL: ${{ secrets.CLAUDOMATOR_WEBHOOK_URL }}
- CLAUDOMATOR_WEBHOOK_SECRET: ${{ secrets.CLAUDOMATOR_WEBHOOK_SECRET }}
- run: |
- PAYLOAD=$(jq -n \
- --arg action "completed" \
- --arg conclusion "${{ job.status }}" \
- --arg name "${{ github.workflow }} / smoke-test" \
- --arg repo "${{ github.repository }}" \
- --arg sha "${{ github.sha }}" \
- --arg run_id "${{ github.run_id }}" \
- '{action: $action, workflow_run: {conclusion: $conclusion, name: $name, head_sha: $sha, id: ($run_id | tonumber)}, repository: {full_name: $repo}}')
- SIG=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$CLAUDOMATOR_WEBHOOK_SECRET" | awk '{print $2}')
- curl -sf -X POST \
- -H "Content-Type: application/json" \
- -H "X-GitHub-Event: workflow_run" \
- -H "X-Hub-Signature-256: sha256=${SIG}" \
- "${CLAUDOMATOR_WEBHOOK_URL}/api/webhooks/github" \
- -d "$PAYLOAD"