Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
reset unrelated file
Browse files Browse the repository at this point in the history
  • Loading branch information
wrmswindmill committed Aug 1, 2019
1 parent 18b13b0 commit 5f7d3d5
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 274 deletions.
126 changes: 18 additions & 108 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
os: linux
language: node_js
node_js: 12.6.0
node_js: 7.6
matrix:
fast_finish: true
include:
# format code using clang-format
- env: TEST_SUITE=code_format
language: ruby
- env: TEST_SUITE=danger
- env: TEST_SUITE=jsfm
- env: TEST_SUITE=ios
Expand All @@ -28,63 +25,29 @@ matrix:
- 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
osx_image: xcode7.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

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
sudo 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
case $TEST_SUITE in
"android")
curl -o- https://github.com/raw/nvm-sh/nvm/v0.34.0/install.sh | bash
nvm install 12.6.0
nvm install 7.6
npm install
echo y | sdkmanager "cmake;3.6.4111459"
if find "${HOME}/android-ndk-r18b" -mindepth 1 | read; then
Expand All @@ -101,24 +64,11 @@ install:
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://github.com/raw/nvm-sh/nvm/v0.34.0/install.sh | bash
nvm install 12.6.0
;;
"jsfm" | "danger" | "ios" )
npm install
elif [[ ("$TEST_SUITE" = "ios") ]]; then
curl -o- https://github.com/raw/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 && pod install --repo-update
cd ../../
elif [[ ("$TEST_SUITE" = "code_format") ]]; then
bundle install
fi
;;
esac
script:
- |
case $TEST_SUITE in
Expand All @@ -137,69 +87,29 @@ script:
GRADLE_ABI=""
;;
esac
if npm run danger -- ci --dangerfile ./dangerfile-android.js | grep -q "hasAndroidFile" ; then
hasAndroidFile=$(npm run danger -- run --dangerfile ./dangerfile-android.js)
echo "The value of hasAndroidFile is ${hasAndroidFile}"
if [[ "$hasAndroidFile" =~ "hasAndroidFile" ]]; then
cd android
./gradlew clean install -PbuildRuntimeApi=true ${GRADLE_ABI} --info
./gradlew install -PbuildRuntimeApi=false ${GRADLE_ABI} --info
fi
;;
"jsfm" )
npm run danger -- ci -i jsfm --dangerfile ./dangerfile-jsfm.js
npm run danger -- run --dangerfile ./dangerfile-jsfm.js
;;
"danger" )
npm run danger -- ci -i danger --dangerfile ./dangerfile.js
npm run danger -- run --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
hasIosFile=$(npm run danger -- run --dangerfile ./dangerfile-ios.js)
echo "The value of hasIosFile is ${hasIosFile}"
if [[ "$hasIosFile" =~ "hasIosFile" ]]; then
xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=iOS Simulator,name=iPhone 6"
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 \
-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
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 lint --quiet
export TITLE="AndroidLint Result"
cd ../ && npm run danger -- ci -i androidlint --dangerfile ./dangerfile-output.js
fi
fi
if [[ ("$TEST_SUITE" = "code_format") ]]; then
echo "exec code format"
bundle exec danger --danger_id=codeFormat
fi
notifications:
webhooks:
on_pull_requests: false
Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ if !ENV['CIRCLECI']
gem "danger"
gem "danger-xcode_summary"
gem "cocoapods"
# fork by 'https://github.com/flix-tech/danger-code_style_validation.git'
# update the message level from fail to warn
gem 'danger-code_style_validation', :git => 'https://github.com/wrmswindmill/danger-code_style_validation.git'
end
end
# gem "danger-prose"
Expand Down
21 changes: 19 additions & 2 deletions dangerfile-ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,22 @@ if (!hasIosFile && danger.git.deleted_files) {
}

if(hasIosFile){
console.log('hasIosFile!!!');
}
console.log('hasIosFile');
}
// console.log('-----------------------------hasIosFile-----------------------------:'+hasIosFile);
// if(hasIosFile){
// var runTestCmd='source ~/.bash_profile; '
// +'xcodebuild -project ios/sdk/WeexSDK.xcodeproj test '
// +'-scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO '
// +'-destination "platform=iOS Simulator,name=iPhone 6"'
// runSuccess = shell.exec(runTestCmd,{ async: false, timeout: 8 * 60 * 1000, maxBuffer: 200 * 1024 * 1024 }).code == 0;
// if(!runSuccess){
// fail("ios platform run unit test failed!");
// }
// }else{
// console.log('has no ios file changed.');
// message('has no ios file changed.');
// }
// message('ios test finished.')


71 changes: 0 additions & 71 deletions dangerfile-output.js

This file was deleted.

89 changes: 0 additions & 89 deletions dangerfile-static-check.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"chromedriver": "^2.21.2",
"cross-spawn": "^4.0.0",
"css-loader": "^0.26.1",
"danger": "^9.0.0",
"danger": "^0.18.0",
"dateformat": "^2.0.0",
"eslint": "^2.11.1",
"eslint-plugin-flowtype": "^2.40.1",
Expand Down

0 comments on commit 5f7d3d5

Please sign in to comment.