summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/android.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 701b6c4..aa292f2 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -42,6 +42,28 @@ jobs:
groups: testers
file: android-app/app/build/outputs/apk/debug/app-debug.apk
+ - 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 }}" \
+ --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"
+
smoke-test:
runs-on: ubuntu-latest
# Run after build succeeds so we don't spin up an emulator for a broken build
@@ -74,3 +96,25 @@ jobs:
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"