#!/bin/bash -ex
UPLOAD_ARTIFACT="$(pwd)/scripts/upload_artifact.sh"
trap "$UPLOAD_ARTIFACT" EXIT
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
source $(dirname "$0")/ci.sh
pushd detox/test
run_f "yarn integration"
popd
pushd detox/android
run_f "yarn unit:android-release"
popd
mkdir -p coverage
pushd detox/test
run_f "node scripts/patch-webview-codegen.js"
run_f "yarn build:android-debug"
run_f "yarn build:android"
run_f "yarn e2e:android"
cp coverage/lcov.info ../../coverage/e2e-emulator-ci.lcov
if [ "$TEST_GENYCLOUD_SANITY" = "true" ]; then
run_f "yarn e2e:android:genycloud e2e/01* e2e/02* e2e/03.actions*"
cp coverage/lcov.info ../../coverage/e2e-genycloud-ci.lcov
fi
run_f "scripts/ci_unhappy.sh android"
popd