| os: linux |
| language: node_js |
| node_js: 12.6.0 |
| matrix: |
| fast_finish: true |
| include: |
| - env: TEST_SUITE=danger |
| - env: TEST_SUITE=jsfm |
| - env: TEST_SUITE=ios |
| os: osx |
| osx_image: xcode11.2 |
| language: objective-c |
| - env: TEST_SUITE=android ABI=armeabi-v7a |
| language: android |
| dist: trusty |
| jdk: oraclejdk8 |
| android: |
| components: |
| - android-26 |
| - extra-android-m2repository |
| - env: TEST_SUITE=android ABI=arm64-v8a |
| language: android |
| dist: trusty |
| jdk: oraclejdk8 |
| android: |
| components: |
| - android-26 |
| - extra-android-m2repository |
| - env: TEST_SUITE=android ABI=x86 |
| language: android |
| dist: trusty |
| jdk: oraclejdk8 |
| android: |
| components: |
| - android-26 |
| - extra-android-m2repository |
| # static check |
| - env: TEST_SUITE=static_code_analysis OCLINT=true |
| os: osx |
| osx_image: xcode11.2 |
| language: objective-c |
| - env: TEST_SUITE=static_code_analysis ANDROID_LINT=true |
| language: android |
| dist: trusty |
| jdk: oraclejdk8 |
| android: |
| components: |
| - android-26 |
| - extra-android-m2repository |
| |
| cache: |
| directories: |
| - npm |
| - $HOME/.gradle/caches/ |
| - $HOME/.gradle/wrapper/ |
| - $HOME/.android/build-cache |
| - $HOME/android-ndk-r18b |
| - bundle |
| |
| git: |
| depth: false |
| |
| before_cache: |
| - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock |
| - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ |
| - rm -fr $HOME/node_modules/* |
| |
| before_install: |
| - | |
| # install android lint |
| if [[ ("$TEST_SUITE" = "static_code_analysis") && ("${ANDROID_LINT}" = "true") ]]; then |
| apt-get install rubygems |
| gem install bundler |
| bundle install |
| fi |
| |
| # install oclint |
| if [[ ("$TEST_SUITE" = "static_code_analysis") && ("${OCLINT}" = "true") ]]; then |
| brew cask uninstall oclint |
| brew tap oclint/formulae |
| brew install oclint |
| fi |
| |
| |
| |
| install: |
| - | |
| if [[ ("$TEST_SUITE" = "android") || ("${ANDROID_LINT}" = "true") ]]; then |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash |
| nvm install 12.6.0 |
| npm install |
| echo y | sdkmanager "cmake;3.6.4111459" |
| if find "${HOME}/android-ndk-r18b" -mindepth 1 | read; then |
| echo "NDK cache hit" |
| else |
| echo "NDK cache missed" |
| rmdir "${HOME}/android-ndk-r18b" |
| fi |
| |
| if [[ ! -d "${HOME}/android-ndk-r18b" ]]; then |
| wget https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip |
| unzip android-ndk-r18b-linux-x86_64.zip -d $HOME |
| fi |
| export ANDROID_NDK_HOME=$HOME/android-ndk-r18b |
| export PATH=$PATH:$ANDROID_NDK_HOME |
| echo "ndk.dir=$ANDROID_NDK_HOME" > android/local.properties |
| elif [[ ("$TEST_SUITE" = "jsfm") || ("$TEST_SUITE" = "danger") || ("${OCLINT}" = "true") ]]; then |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash |
| nvm install 12.6.0 |
| npm install |
| elif [[ ("$TEST_SUITE" = "ios") ]]; then |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash |
| nvm install 12.6.0 |
| |
| git submodule update --init --remote |
| cd weex-playground/ios && bash update_podfile_for_travisci.sh |
| cd ../../ && npm install |
| cd weex-playground/ios && bundle install && pod install --repo-update |
| cd ../../ |
| fi |
| |
| |
| script: |
| - | |
| case $TEST_SUITE in |
| "android") |
| case $ABI in |
| "armeabi-v7a" ) |
| GRADLE_ABI="-PsupportArmeabi-v7a=true -PsupportArm64-v8a=false -PsupportX86=false" |
| ;; |
| "arm64-v8a" ) |
| GRADLE_ABI="-PsupportArmeabi-v7a=false -PsupportArm64-v8a=true -PsupportX86=false" |
| ;; |
| "x86" ) |
| GRADLE_ABI="-PsupportArmeabi-v7a=false -PsupportArm64-v8a=false -PsupportX86=true" |
| ;; |
| "*" ) |
| GRADLE_ABI="" |
| ;; |
| esac |
| if npm run danger -- ci --dangerfile ./dangerfile-android.js | grep -q "hasAndroidFile" ; then |
| cd android |
| ./gradlew clean assembleRelease --quiet -PbuildRuntimeApi=true ${GRADLE_ABI} -PapachePackageName="false" || exit 1 |
| ./gradlew assembleRelease --quiet ${GRADLE_ABI} -PbuildRuntimeApi=false -Pjsc_url="https://raw.githubusercontent.com/apache/incubator-weex/release/0.26/android/sdk/weex_sdk-0.26.0.aar" -Paar_name="weex_sdk" -PJSInterpolatorName="JavaScriptCore" -PapachePackageName="false" || exit 1 |
| ./gradlew :weex_sdk:assembleRelease --quiet -PbuildRuntimeApi=true ${GRADLE_ABI} -PapachePackageName="true" || exit 1 |
| ./gradlew :weex_sdk:assembleRelease --quiet ${GRADLE_ABI} -PbuildRuntimeApi=false -Pjsc_url="https://raw.githubusercontent.com/apache/incubator-weex/release/0.26/android/sdk/weex_sdk-0.26.0.aar" -Paar_name="weex_sdk" -PJSInterpolatorName="JavaScriptCore" -PapachePackageName="true" || exit 1 |
| fi |
| ;; |
| "jsfm" ) |
| npm run danger -- ci -i jsfm --dangerfile ./dangerfile-jsfm.js |
| ;; |
| "danger" ) |
| npm run danger -- ci -i danger --dangerfile ./dangerfile.js |
| ;; |
| "ios" ) |
| if npm run danger -- ci --dangerfile ./dangerfile-ios.js | grep -q "hasIosFile" ; then |
| # build WeexSDK and run WeexSDKTests |
| xcodebuild -quiet -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 |
| # build WeexDemo and run WeexDemo test |
| cd weex-playground/ios && mkdir tmp && mv * tmp;cd tmp |
| xcodebuild -quiet -workspace WeexDemo.xcworkspace test -scheme WeexDemo CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6" || exit 1 |
| fi |
| ;; |
| esac |
| |
| if [[ ("$TEST_SUITE" = "static_code_analysis") && ("${OCLINT}" = "true") ]]; then |
| if npm run danger -- ci --dangerfile ./dangerfile-static-check.js | grep -q "hasCFile" ; then |
| echo "hasCFile" |
| cd ios/sdk && xcodebuild | xcpretty -r json-compilation-database -o compile_commands.json |
| oclint-json-compilation-database oclint_args -- \ |
| -disable-rule=ShortVariableName \ |
| -disable-rule=LongLine \ |
| -disable-rule=LongMethod \ |
| -disable-rule=HighNcssMethod \ |
| -disable-rule=LongVariableName \ |
| -disable-rule=HighCyclomaticComplexity \ |
| -disable-rule=HighNPathComplexity \ |
| -disable-rule=UnusedLocalVariable \ |
| -disable-rule=DoubleNegative \ |
| -disable-rule=MultipleUnaryOperator \ |
| -disable-rule=DeepNestedBlock \ |
| -disable-rule=AssignIvarOutsideAccessors \ |
| -disable-rule=BitwiseOperatorInConditional \ |
| -max-priority-1=15000 \ |
| -max-priority-2=15000 \ |
| -max-priority-3=15000 > oclint.log |
| export TITLE="OCLint Result" |
| cd ../../ && npm run danger -- ci -i oclint --dangerfile ./dangerfile-output.js || exit 1 |
| fi |
| fi |
| |
| if [[ ("$TEST_SUITE" = "static_code_analysis") && ("${ANDROID_LINT}" = "true") ]]; then |
| if npm run danger -- ci --dangerfile ./dangerfile-static-check.js | grep -q "hasAndroidFile" ; then |
| echo "hasAndroidFile" |
| cd android |
| ./gradlew :weex_sdk:lintLegacyRelease -PapachePackageName="false" --quiet |
| ./gradlew :weex_sdk:lintApacheRelease -PapachePackageName="true" --quiet |
| export TITLE="AndroidLint Result" |
| cd ../ && npm run danger -- ci -i androidlint --dangerfile ./dangerfile-output.js || exit 1 |
| fi |
| fi |
| |
| notifications: |
| webhooks: |
| on_pull_requests: false |
| urls: |
| - https://oapi.dingtalk.com/robot/send?access_token=5a6be5eb6ad180fa4d04bdda0b24857ee49c3dd985361efdf0964aa9134ee623 |
| on_success: never |
| on_failure: always |
| email: |
| recipients: |
| - weexnotify@gmail.com |
| on_success: never |
| on_failure: always |