chore: Replace occurrences of the deprecated errorAndThrow API #318
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Functional Tests | |
on: | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- apiLevel: 32 | |
emuTag: google_apis | |
arch: x86_64 | |
- apiLevel: 30 | |
emuTag: google_apis | |
arch: x86 | |
- apiLevel: 29 | |
emuTag: default | |
arch: x86 | |
- apiLevel: 25 | |
emuTag: default | |
arch: x86 | |
- apiLevel: 23 | |
emuTag: default | |
arch: x86 | |
env: | |
CI: true | |
ANDROID_AVD: emulator | |
ANDROID_SDK_VERSION: ${{ matrix.apiLevel }} | |
APPIUM_TEST_SERVER_PORT: 4567 | |
APPIUM_TEST_SERVER_HOST: 127.0.0.1 | |
_FORCE_LOGS: 1 | |
# No hardware acceleration is available for emulators on Ubuntu: | |
# https://github.com/marketplace/actions/android-emulator-runner#can-i-use-this-action-on-linux-vms | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
check-latest: true | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- 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: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.apiLevel }} | |
- name: create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
avd-name: ${{ env.ANDROID_AVD }} | |
force-avd-creation: false | |
api-level: ${{ matrix.apiLevel }} | |
disable-spellchecker: true | |
target: ${{ matrix.emuTag }} | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim | |
arch: ${{ matrix.arch }} | |
disable-animations: true | |
script: echo "Generated AVD snapshot for caching." | |
- run: | | |
npm install -g appium | |
npm install | |
npm install --no-save mjpeg-consumer | |
name: Install dev dependencies | |
- run: | | |
pushd "$(pwd)/espresso-server" | |
nohup ./gradlew -PappiumTargetPackage=io.appium.android.apis app:assembleAndroidTest | |
popd | |
name: Prebuild Espresso server | |
- run: | | |
cwd=$(pwd) | |
pushd "$cwd" | |
cd ~ | |
appium driver install --source=local "$cwd" | |
appium driver doctor espresso | |
nohup appium server \ | |
--port=$APPIUM_TEST_SERVER_PORT \ | |
--address=$APPIUM_TEST_SERVER_HOST \ | |
--relaxed-security \ | |
2>&1 > "$cwd/appium.log" & | |
popd | |
name: Start Appium server | |
- run: nohup adb logcat > logcat.log & | |
name: Capture logcat | |
- uses: reactivecircus/android-emulator-runner@v2 | |
name: e2e_api${{ matrix.apiLevel }} | |
with: | |
script: npx mocha --timeout 10m ./test/functional/driver-e2e-specs.js ./test/functional/commands/jetpack-compose-attributes-e2e-specs.js -g @skip-ci -i --exit | |
avd-name: ${{ env.ANDROID_AVD }} | |
force-avd-creation: false | |
api-level: ${{ matrix.apiLevel }} | |
disable-spellchecker: true | |
disable-animations: true | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim | |
target: ${{ matrix.emuTag }} | |
arch: ${{ matrix.arch }} | |
- name: Save logcat output | |
if: ${{ always() }} | |
uses: actions/upload-artifact@master | |
with: | |
name: logcat-api${{ matrix.apiLevel }} | |
path: logcat.log | |
- name: Save server output | |
if: ${{ always() }} | |
uses: actions/upload-artifact@master | |
with: | |
name: appium-api${{ matrix.apiLevel }} | |
path: appium.log |