Skip to content

Commit 6b88322

Browse files
committed
Add GitHub Actions workflow for APK build verification
This adds a CI workflow that: - Builds the debug APK on every push and pull request - Sets up JDK 11 and Android SDK with NDK - Caches Gradle dependencies for faster builds - Creates dummy google-services.json for CI builds - Uploads the built APK as an artifact - Runs Android Lint checks in a separate job The workflow triggers on: - Pushes to master, main, and claude/* branches - Pull requests to master and main branches
1 parent 7ed2a4a commit 6b88322

1 file changed

Lines changed: 171 additions & 0 deletions

File tree

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Android Build
2+
3+
on:
4+
push:
5+
branches: [ master, main, 'claude/**' ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '11'
21+
distribution: 'temurin'
22+
23+
- name: Setup Android SDK
24+
uses: android-actions/setup-android@v3
25+
26+
- name: Install NDK
27+
run: |
28+
sdkmanager --install "ndk;21.4.7075529"
29+
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529" >> $GITHUB_ENV
30+
31+
- name: Cache Gradle packages
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.gradle/caches
36+
~/.gradle/wrapper
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
38+
restore-keys: |
39+
${{ runner.os }}-gradle-
40+
41+
- name: Grant execute permission for gradlew
42+
run: chmod +x gradlew
43+
44+
- name: Create local.properties
45+
run: |
46+
echo "sdk.dir=$ANDROID_HOME" > local.properties
47+
echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties
48+
49+
- name: Create dummy google-services.json
50+
run: |
51+
mkdir -p app
52+
cat > app/google-services.json << 'EOF'
53+
{
54+
"project_info": {
55+
"project_number": "000000000000",
56+
"project_id": "dummy-project",
57+
"storage_bucket": "dummy-project.appspot.com"
58+
},
59+
"client": [
60+
{
61+
"client_info": {
62+
"mobilesdk_app_id": "1:000000000000:android:0000000000000000",
63+
"android_client_info": {
64+
"package_name": "org.proxydroid"
65+
}
66+
},
67+
"oauth_client": [],
68+
"api_key": [
69+
{
70+
"current_key": "dummy-api-key"
71+
}
72+
],
73+
"services": {
74+
"appinvite_service": {
75+
"other_platform_oauth_client": []
76+
}
77+
}
78+
}
79+
],
80+
"configuration_version": "1"
81+
}
82+
EOF
83+
84+
- name: Build Debug APK
85+
run: ./gradlew assembleDebug --stacktrace
86+
87+
- name: Upload Debug APK
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: app-debug
91+
path: app/build/outputs/apk/debug/app-debug.apk
92+
retention-days: 7
93+
94+
lint:
95+
runs-on: ubuntu-latest
96+
97+
steps:
98+
- name: Checkout code
99+
uses: actions/checkout@v4
100+
101+
- name: Set up JDK 11
102+
uses: actions/setup-java@v4
103+
with:
104+
java-version: '11'
105+
distribution: 'temurin'
106+
107+
- name: Setup Android SDK
108+
uses: android-actions/setup-android@v3
109+
110+
- name: Cache Gradle packages
111+
uses: actions/cache@v4
112+
with:
113+
path: |
114+
~/.gradle/caches
115+
~/.gradle/wrapper
116+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
117+
restore-keys: |
118+
${{ runner.os }}-gradle-
119+
120+
- name: Grant execute permission for gradlew
121+
run: chmod +x gradlew
122+
123+
- name: Create local.properties
124+
run: echo "sdk.dir=$ANDROID_HOME" > local.properties
125+
126+
- name: Create dummy google-services.json
127+
run: |
128+
mkdir -p app
129+
cat > app/google-services.json << 'EOF'
130+
{
131+
"project_info": {
132+
"project_number": "000000000000",
133+
"project_id": "dummy-project",
134+
"storage_bucket": "dummy-project.appspot.com"
135+
},
136+
"client": [
137+
{
138+
"client_info": {
139+
"mobilesdk_app_id": "1:000000000000:android:0000000000000000",
140+
"android_client_info": {
141+
"package_name": "org.proxydroid"
142+
}
143+
},
144+
"oauth_client": [],
145+
"api_key": [
146+
{
147+
"current_key": "dummy-api-key"
148+
}
149+
],
150+
"services": {
151+
"appinvite_service": {
152+
"other_platform_oauth_client": []
153+
}
154+
}
155+
}
156+
],
157+
"configuration_version": "1"
158+
}
159+
EOF
160+
161+
- name: Run Lint
162+
run: ./gradlew lint --stacktrace
163+
continue-on-error: true
164+
165+
- name: Upload Lint Results
166+
uses: actions/upload-artifact@v4
167+
if: always()
168+
with:
169+
name: lint-results
170+
path: app/build/reports/lint-results*.html
171+
retention-days: 7

0 commit comments

Comments
 (0)