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

Commit

Permalink
change to yarn because npm package error and install android lint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wrmswindmill committed Jul 30, 2019
1 parent 09bf60e commit 748fa44
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,18 @@ before_install:
brew tap oclint/formulae
brew install oclint
fi
# 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:
- |
npm install yarn
if [[ ("$TEST_SUITE" = "android") || ("${ANDROID_LINT}" = "true") ]]; then
curl -o- https://github.com/raw/nvm-sh/nvm/v0.34.0/install.sh | bash
nvm install 12.6.0
Expand Down Expand Up @@ -103,6 +112,7 @@ install:
elif [[ ("$TEST_SUITE" = "code_format") ]]; then
bundle install
fi
script:
- |
Expand All @@ -123,7 +133,7 @@ script:
;;
esac
hasAndroidFile=$(npm run danger -- ci --dangerfile ./dangerfile-android.js)
hasAndroidFile=$(yarn danger ci --dangerfile ./dangerfile-android.js)
echo "The value of hasAndroidFile is ${hasAndroidFile}"
if [[ "$hasAndroidFile" =~ "hasAndroidFile" ]]; then
cd android
Expand All @@ -132,13 +142,13 @@ script:
fi
;;
"jsfm" )
npm run danger -- ci -i jsfm --dangerfile ./dangerfile-jsfm.js
yarn danger ci -i jsfm --dangerfile ./dangerfile-jsfm.js
;;
"danger" )
npm run danger -- ci -i danger --dangerfile ./dangerfile.js
yarn danger ci -i danger --dangerfile ./dangerfile.js
;;
"ios" )
hasIosFile=$(npm run danger -- ci --dangerfile ./dangerfile-ios.js)
hasIosFile=$(yarn danger ci --dangerfile ./dangerfile-ios.js)
echo "The value of hasIosFile is ${hasIosFile}"
if [[ "$hasIosFile" =~ "hasIosFile" ]]; then
# build WeexSDK and run WeexSDKTests
Expand All @@ -151,7 +161,7 @@ script:
esac
if [[ ("$TEST_SUITE" = "static_code_analysis") && ("${OCLINT}" = "true") ]]; then
hasCFile=$(npm run danger -- ci --dangerfile ./dangerfile-static-check.js)
hasCFile=$(yarn danger ci --dangerfile ./dangerfile-static-check.js)
echo "The value of hasCFile is ${hasCFile}"
if [[ "$hasCFile" =~ "hasCFile" ]]; then
echo "hasCFile"
Expand All @@ -173,23 +183,16 @@ script:
-max-priority-2=15000 \
-max-priority-3=15000 > oclint.log
export COMMAND="cat ios/sdk/oclint.log | grep -i \"P[1|2]\""
cd ../../ && npm run danger -- ci -i output --dangerfile ./dangerfile-output.js
cd ../../ && yarn danger ci -i output --dangerfile ./dangerfile-output.js
fi
fi
if [[ ("$TEST_SUITE" = "static_code_analysis") && ("${ANDROID_LINT}" = "true") ]]; then
hasAndroidFile=$(npm run danger -- ci --dangerfile ./dangerfile-static-check.js)
hasAndroidFile=$(yarn danger ci --dangerfile ./dangerfile-static-check.js)
echo "The value of hasAndroidFile is ${hasAndroidFile}"
if [[ "$hasAndroidFile" =~ "hasAndroidFile" ]]; then
# format code using google-java-format at first
# for n in `find ./android -name "*.java"`; do
# java -jar ./format-tool/google-java-format-1.7-all-deps.jar --replace $n
# done
# then run android lint
# echo "hasAndroidFile"
echo "run android lint"
cd android
./gradlew lint
echo "hasAndroidFile"
bundle exec danger --danger_id=androidLint --dangerfile=./Dangerfile-android
fi
fi
Expand Down
2 changes: 2 additions & 0 deletions Dangerfile-android
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android_lint.severity = "Error"
android_lint.lint
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if !ENV['CIRCLECI']
# 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'
# android lint
gem 'danger-android_lint'
end
end
# gem "danger-prose"
Expand Down

0 comments on commit 748fa44

Please sign in to comment.