Files
richΛrdandJacek Sieka ebb64680fe ci(mobile): run test suite on Android and iOS (#695)
* ci(mobile): run test suite on Android and iOS

* ci(mobile): authenticate Nim setup

* ci(mobile): propagate test failures

* test(android): skip host FD limit test

* ci: restrict mobile workflow permissions

* docs(ci): explain mobile test execution

* docs(ci): trim mobile workflow comments

* ci: use configured Nim for mobile tests

* ci: show Nim version in mobile job names

---------

Co-authored-by: Jacek Sieka <jacek@status.im>
2026-08-13 08:55:36 +00:00

67 lines
2.1 KiB
YAML

name: Mobile Android
on:
push:
branches:
- master
pull_request:
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-android:
name: Android x86_64 tests (Nim version-2-2)
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: "2.2.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: nimble install -y --depsOnly
- name: Configure Android toolchain
run: |
toolchain="$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin"
echo "NIMFLAGS=--os:android --cpu:amd64 --cc:clang --clang.path:$toolchain --clang.exe:x86_64-linux-android23-clang --clang.linkerexe:x86_64-linux-android23-clang --passL:-llog" >> "$GITHUB_ENV"
- name: Enable KVM for Android emulator
run: |
sudo tee /etc/udev/rules.d/99-kvm4all.rules >/dev/null <<'EOF'
KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"
EOF
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Build and run tests on Android emulator
uses: reactivecircus/android-emulator-runner@v2
env:
NIM_TEST_RUNNER: bash .github/scripts/run-android-tests.sh
NIM_TEST_SUCCESS_MARKER: build/mobile-tests-passed
with:
api-level: 23
arch: x86_64
target: default
force-avd-creation: false
emulator-options: -no-window -no-audio -no-boot-anim -no-metrics -gpu swiftshader_indirect
disable-animations: true
script: |
# The marker is written only after every test configuration finishes.
rm -f "$NIM_TEST_SUCCESS_MARKER"
nimble test
test -f "$NIM_TEST_SUCCESS_MARKER"