File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,10 +157,11 @@ aliases:
157157 - &run-js-tests
158158 name : JavaScript Test Suite
159159 command : yarn test-ci
160-
160+
161+ # eslint sometimes runs into trouble generating the reports
161162 - &run-lint-checks
162163 name : Lint code
163- command : yarn lint --format junit -o ~/react-native/reports/junit/js-lint-results.xml
164+ command : scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/js-lint-results.xml
164165 when : always
165166
166167 - &run-flow-checks
@@ -251,13 +252,16 @@ js_defaults: &js_defaults
251252 << : *defaults
252253 docker :
253254 - image : circleci/node:8
255+ environment :
256+ - PATH : " /opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
254257
255258android_defaults : &android_defaults
256259 << : *defaults
257260 docker :
258261 - image : circleci/android:api-26-alpha
259262 resource_class : " large"
260263 environment :
264+ - PATH : " /opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
261265 - TERM : " dumb"
262266 - ADB_INSTALL_TIMEOUT : 10
263267 - _JAVA_OPTIONS : " -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
@@ -539,7 +543,7 @@ jobs:
539543 command : |
540544 # GITHUB_TOKEN=eslint-bot public_repo access token
541545 if [ -n "$CIRCLE_PR_NUMBER" ]; then
542- cat <(echo eslint; yarn --silent lint --format=json; echo flow; yarn --silent flow check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
546+ GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER scripts/circleci/analyze_code.sh
543547 else
544548 echo "Skipping code analysis."
545549 fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cat <( echo eslint; yarn --silent lint --format=json; echo flow; yarn --silent flow check --json) | GITHUB_TOKEN=$GITHUB_TOKEN CI_USER=$CI_USER CI_REPO=$CI_REPO PULL_REQUEST_NUMBER=$PULL_REQUEST_NUMBER node bots/code-analysis-bot.js
4+
5+ # check status
6+ STATUS=$?
7+ if [ $STATUS == 0 ]; then
8+ echo " Code analyzed successfully"
9+ else
10+ echo " Code analyzis failed, error status $STATUS "
11+ fi
12+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # execute command
4+ $@
5+
6+ # check status
7+ STATUS=$?
8+ if [ $STATUS == 0 ]; then
9+ echo " Command '$@ ' completed successfully"
10+ else
11+ echo " Command '$@ ' exited with error status $STATUS "
12+ fi
13+
You can’t perform that action at this time.
0 commit comments