-
-
Notifications
You must be signed in to change notification settings - Fork 786
118 lines (106 loc) · 3.65 KB
/
Copy pathe2e-tests.yml
File metadata and controls
118 lines (106 loc) · 3.65 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: E2E Android Build (manual)
on:
# Manual trigger. Pick the branch/tag to build via the GitHub
# "Use workflow from" selector (or `gh workflow run --ref <branch>`);
# checkout below builds whatever ref the run was dispatched on.
workflow_dispatch:
permissions:
contents: read
env:
NODE_VERSION: '22'
JAVA_VERSION: '17'
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Create dummy google-services.json for CI
run: |
cat > android/app/google-services.json << 'EOL'
{
"project_info": {
"project_number": "000000000000",
"project_id": "dummy-project-for-ci",
"storage_bucket": "dummy-project-for-ci.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:000000000000:android:0000000000000000",
"android_client_info": {
"package_name": "com.pocketpalai"
}
},
"api_key": [{
"current_key": "dummy-api-key-for-ci-builds"
}]
},
{
"client_info": {
"mobilesdk_app_id": "1:000000000000:android:1111111111111111",
"android_client_info": {
"package_name": "com.pocketpalai.e2e"
}
},
"api_key": [{
"current_key": "dummy-api-key-for-ci-builds"
}]
}
]
}
EOL
- name: Create dummy .env file for CI
run: |
cat > .env << 'EOL'
FIREBASE_FUNCTIONS_URL=https://dummy-firebase-url.com
SUPABASE_URL=https://dummy-supabase-url.supabase.co
SUPABASE_ANON_KEY=dummy-anon-key-for-ci-builds
PALSHUB_API_BASE_URL=https://dummy-palshub-api.com
APP_URL=pocketpal://app
ENABLE_PALSHUB_INTEGRATION=true
ENABLE_AUTHENTICATION=true
ENABLE_OFFLINE_MODE=true
GOOGLE_IOS_CLIENT_ID=dummy-ios-client-id.apps.googleusercontent.com
GOOGLE_WEB_CLIENT_ID=dummy-web-client-id.apps.googleusercontent.com
EOL
- name: Create dummy release keystore for CI
working-directory: android/app
run: |
keytool -genkeypair -v \
-storetype PKCS12 \
-keystore pocketpal-release-key.keystore \
-alias pocketpal_key_alias \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-storepass dummy-ci-password \
-keypass dummy-ci-password \
-dname "CN=CI Build, OU=CI, O=PocketPal, L=CI, S=CI, C=US"
- name: Build Android E2E APK
env:
APP_RELEASE_STORE_PASSWORD: dummy-ci-password
APP_RELEASE_KEY_PASSWORD: dummy-ci-password
run: |
cd android
E2E_BUILD=true ./gradlew assembleE2eReleaseE2e
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: e2e-android-apk
path: android/app/build/outputs/apk/e2e/releaseE2e/app-e2e-releaseE2e.apk
retention-days: 30