代码拉取完成,页面将自动刷新
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status.
for line in $(find . -name 'gradlew'); do
p=$(dirname "${line}");
name="${p##*/}";
echo
echo
echo Running unit and Android tests in $name
echo "====================================================================="
pushd $p > /dev/null # Silent pushd
./gradlew :app:assembleDebug -PdisablePreDex | sed "s@^@$name @" # Prefix every line with directory
code=${PIPESTATUS[0]}
if [ "$code" -ne "0" ]; then
exit $code
fi
./gradlew :app:assembleAndroidTest -PdisablePreDex | sed "s@^@$name @" # Prefix every line with directory
./gradlew test -PdisablePreDex | sed "s@^@$name @" # Prefix every line with directory
apkfile=app/build/outputs/apk/debug/app-debug.apk
testapkfile=app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
if [ ! -f $apkfile ] || [ ! -f $testapkfile ] ; then
echo "APKs not found, probably due to project using multiple flavors. Skipping $name"
popd > /dev/null # Silent popd
continue
fi
echo "Sending APKs to Firebase..."
echo "y" | sudo /opt/google-cloud-sdk/bin/gcloud firebase test android run --app $apkfile --test $testapkfile -d Nexus5X -v 26 -l fr --results-bucket=android-architecture-components-test-results --results-dir=$CIRCLE_BUILD_NUM/$name
code=${PIPESTATUS[0]}
if [ "$code" -ne "0" ]; then
exit $code
fi
# Copy the test results to the build artifacts folder in CircleCI
sudo /opt/google-cloud-sdk/bin/gsutil -m cp -r -U `sudo /opt/google-cloud-sdk/bin/gsutil ls gs://android-architecture-components-test-results/$CIRCLE_BUILD_NUM/$name/**/test_result*.xml | tail -1` $CIRCLE_ARTIFACTS/ | true
popd > /dev/null # Silent popd
done
echo
echo "ALL TESTS PASS"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。