-
Notifications
You must be signed in to change notification settings - Fork 21
73 lines (70 loc) · 2.72 KB
/
Copy pathandroid-leap-chat-test.yml
File metadata and controls
73 lines (70 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Android LeapChat Build
on:
push:
branches: [ main ]
paths:
- 'Android/LeapChat/**'
- 'Android/YouTubeSummarizer/**'
- '.github/workflows/android-leap-chat-test.yml'
pull_request:
branches: [ main ]
paths:
- 'Android/LeapChat/**'
- 'Android/YouTubeSummarizer/**'
- '.github/workflows/android-leap-chat-test.yml'
workflow_dispatch:
# Least-privilege default. The job authenticates with gcloud against Firebase
# Test Lab via a service-account JSON; nothing here needs GITHUB_TOKEN write
# scope. The Actions cache (used by gradle/actions/setup-gradle below) is gated
# by the runtime token, not GITHUB_TOKEN, so contents: read is sufficient.
permissions:
contents: read
jobs:
build-and-e2e-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
- name: Build LeapChat
run: cd Android/LeapChat && ./gradlew :app:assemble
- name: Build E2E test
run: cd Android/LeapChat && ./gradlew :app:assembleAndroidTest
- name: Run E2E test on Firebase Test Lab
env:
SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
run: |
# Land the SA JSON under $RUNNER_TEMP, mode 600, with a trap cleanup
# so a job failure or cancellation doesn't leave the key on disk.
# printf (not echo) preserves backslash sequences in the JSON.
SA_FILE="${RUNNER_TEMP:-/tmp}/service_account.json"
trap 'rm -f "$SA_FILE"' EXIT
( umask 077 && printf '%s' "$SERVICE_ACCOUNT" > "$SA_FILE" )
gcloud auth activate-service-account --key-file="$SA_FILE"
gcloud firebase test android run --type instrumentation \
--app Android/LeapChat/app/build/outputs/apk/debug/app-debug.apk \
--test Android/LeapChat/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device model=MediumPhone.arm,version=36,locale=en,orientation=portrait \
--project liquid-leap
unit-test-youtube-summarizer:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
- name: Run YouTubeSummarizer unit tests
run: cd Android/YouTubeSummarizer && ./gradlew :app:test