Repository navigation
65 lines (54 loc) · 2.15 KB
/
Copy pathandroid-ci.yml
File metadata and controls
65 lines (54 loc) · 2.15 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
name: Android CI
on:
pull_request:
branches: [main]
push:
branches: [main, feature/termux-agent-room]
workflow_dispatch:
permissions:
contents: read
jobs:
verify-and-build:
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Validate Termux scripts
run: |
bash -n termux/codein-bootstrap.sh
python3 -m py_compile termux/server.py termux/with-key.py termux/test_mcp.py
python3 -m unittest termux/test_mcp.py
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Install Android 36 toolchain
shell: bash
run: |
set -euo pipefail
SDKMANAGER="${ANDROID_HOME:-}/cmdline-tools/latest/bin/sdkmanager"
if [[ ! -x "$SDKMANAGER" ]]; then
SDKMANAGER="$(command -v sdkmanager || true)"
fi
[[ -x "$SDKMANAGER" ]] || { echo "Android sdkmanager was not found"; exit 1; }
yes | "$SDKMANAGER" --licenses >/dev/null || true
"$SDKMANAGER" "platforms;android-36" "build-tools;36.0.0"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
# This repo's checked-in wrapper JAR is not in Gradle's published checksum catalog.
# Regenerate it from the runner's trusted Gradle installation before executing it.
validate-wrappers: false
- name: Regenerate trusted Gradle wrapper
run: gradle wrapper --gradle-version 9.3.1 --distribution-type bin
- name: Test clickable chat links
run: bash ./gradlew --no-daemon :app:testDebugUnitTest --tests com.example.ChatLinksTest --tests com.example.InteractiveBrowserTest --tests com.example.CodeinUpdateCatalogTest --tests com.example.termux.TermuxRunIdTest
- name: Build debug APK
run: bash ./gradlew --no-daemon :app:assembleDebug
- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: Codein-Termux-Agent-Room-debug
path: app/build/outputs/apk/debug/*.apk
if-no-files-found: error