Skip to content

ci: add android

ci: add android #165

Workflow file for this run

name: Functional Tests
on:
# Run by manual at this time
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ios_test:
runs-on: macos-15
timeout-minutes: 90
env:
XCODE_VERSION: 16.4
IOS_VERSION: 18.5
IOS_DEVICE_NAME: iPhone 16 Plus
steps:
- uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
- uses: futureware-tech/simulator-action@v5
with:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
model: ${{ env.IOS_DEVICE_NAME }}
os_version: ${{ env.IOS_VERSION }}
- name: Preparing other environment
run: |
brew install ffmpeg
brew tap wix/brew
brew install applesimutils
# Start Appium
- name: Install appium and mjpeg-consumer
run: |
npm install -g appium
npm install -g mjpeg-consumer
- run: |
appium driver install xcuitest
appium plugin install images
appium plugin install execute-driver
nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors > appium.log &
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 4.0
- run: |
bundle install
rake ios
name: Run tests
timeout-minutes: 60
working-directory: ios_tests
- name: Save server output
if: ${{ always() }}
uses: actions/upload-artifact@master
with:
name: appium-ios_test_with_other_deps.log
path: |
appium.log
test/report/
android_test:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
API_LEVEL: 35
ARCH: x86_64
steps:
- uses: actions/checkout@v6
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 4.0
- name: Install appium
run: |
npm install -g appium
npm install -g mjpeg-consumer
- name: Start appium
run: |
appium driver install uiautomator2
appium plugin install images
appium plugin install execute-driver
nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors > appium.log &
- name: Enable KVM group perms
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: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.API_LEVEL }}
- name: Create AVD snapshot for cache
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
arch: ${{ env.ARCH }}
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
disable-spellchecker: true
script: |
adb devices
cd android_tests
bundle install
rake android
- name: Run Android tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
arch: ${{ env.ARCH }}
target: google_apis
profile: Nexus 5X
disable-animations: true
disable-spellchecker: true
script: |
adb devices
cd android_tests
bundle install
rake android
- name: Save server output
if: ${{ always() }}
uses: actions/upload-artifact@master
with:
name: appium-android_test_with_other_deps.log
path: |
appium.log
test/report/