Files
app/.github/workflows/android.yml
T
Claude a02a578a5d Linux in the local terminal: Alpine with proot, the phone's storage at /sdcard
- proot (Termux's, external/proot) and its loader built with the NDK
  for each ABI by native-proot/build.sh (talloc fetched and checked by
  SHA-256, built as one file), run by Gradle before each build and
  packaged as libproot.so and libproot-loader.so: extracted on install,
  in the native library directory, the one place Android 10 on lets an
  app run its own programs
- LinuxSystem: Alpine's minimal root file system for the phone's ABI,
  found in Alpine's release list, downloaded with its SHA-256 checked,
  unpacked (Tar: ustar, pax and GNU names, links and modes, nothing
  written outside it, removed without following links), set up (the
  phone's name servers, a prompt) and run as root with proot: the
  device's /dev, /proc and /sys, made-up /proc files for those Android
  hides, hard links as proot's link2symlink, and the phone's shared
  storage at /sdcard when the app has "all files access"
- Settings, Linux: install (it goes on while the user moves about the
  app), size, open a shell, remove; the storage permission; the
  terminal's menu offers "New Linux shell (Alpine)", installing first
  when it isn't there
- Hang-up sent again shortly after the first, for a job the shell was
  forking as it went (found by the tests)
- Tests on the host: proot built by the same script, Alpine downloaded:
  a root shell, the storage both ways, the window's size, hard links,
  apk installing a package and running it, removal leaving the storage;
  the tar reader against GNU and pax tars and ones made to escape; the
  app installing it from Settings and opening its shell. CI installs
  gawk and mksh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-16 21:03:36 +00:00

125 lines
3.7 KiB
YAML

# build: the APK (all four ABIs), the unit tests and lint.
# native: the native engine on the runner against a dmodemd over loopback
# SIP (native-test).
# device: the instrumented tests on an emulator (x86_64): the native library
# loads, binds and answers AT commands.
#
# D-Modem-RE is a private submodule: the DMODEM_RE_TOKEN secret is a token
# that can read it (a fine-grained personal access token with Contents:
# read on Neo-Desktop/D-Modem-RE).
name: Android
on:
push:
pull_request:
env:
NDK_VERSION: "29.0.14206865"
CMAKE_VERSION: "3.31.6"
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.DMODEM_RE_TOKEN || github.token }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- uses: gradle/actions/setup-gradle@v4
- name: SDK packages
run: |
yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \
"ndk;$NDK_VERSION" "cmake;$CMAKE_VERSION" "platforms;android-37.0"
- name: OpenSSH, PuTTY, mksh (the interop tests), gawk (proot's build)
run: sudo apt-get install -y -q openssh-client openssh-server putty-tools gawk mksh && sudo mkdir -p /run/sshd
- name: Build, unit tests, lint
run: ./gradlew assembleDebug assembleDebugAndroidTest testDebugUnitTest lintDebug
- uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
- uses: actions/upload-artifact@v4
if: always()
with:
name: reports
path: |
app/build/reports
app/build/test-results
native:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.DMODEM_RE_TOKEN || github.token }}
- name: Packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends cmake ninja-build g++ libssl-dev
- name: Build
run: |
cmake -S native-test -B build-host -G Ninja
cmake --build build-host
- name: Engine test
run: ctest --test-dir build-host --output-on-failure
device:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.DMODEM_RE_TOKEN || github.token }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- uses: gradle/actions/setup-gradle@v4
- name: gawk (proot's build)
run: sudo apt-get install -y -q gawk
- name: KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: SDK packages
run: |
yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \
"ndk;$NDK_VERSION" "cmake;$CMAKE_VERSION" "platforms;android-37.0"
- name: Instrumented tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
arch: x86_64
target: google_apis
disable-animations: true
script: ./gradlew connectedDebugAndroidTest
- uses: actions/upload-artifact@v4
if: always()
with:
name: device-reports
path: app/build/reports/androidTests