Explicitly set path to yarn
Summary: Due to issues with Circle's Docker images ([link](https://twitter.com/circleci/status/974694807091073024)), jobs are failing with an error "yarn not found". Test Plan Run on Circle Release Notes [GENERAL][MINOR][.circleci] - Fix Circle issue Closes https://github.com/facebook/react-native/pull/18419 Differential Revision: D7312052 Pulled By: hramos fbshipit-source-id: 2768b9c69046a2f80518430024d3e7afbbd7de65
This commit is contained in:
parent
076b1cea35
commit
6f6084db69
|
@ -157,10 +157,11 @@ aliases:
|
||||||
- &run-js-tests
|
- &run-js-tests
|
||||||
name: JavaScript Test Suite
|
name: JavaScript Test Suite
|
||||||
command: yarn test-ci
|
command: yarn test-ci
|
||||||
|
|
||||||
|
# eslint sometimes runs into trouble generating the reports
|
||||||
- &run-lint-checks
|
- &run-lint-checks
|
||||||
name: Lint code
|
name: Lint code
|
||||||
command: yarn lint --format junit -o ~/react-native/reports/junit/js-lint-results.xml
|
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/js-lint-results.xml
|
||||||
when: always
|
when: always
|
||||||
|
|
||||||
- &run-flow-checks
|
- &run-flow-checks
|
||||||
|
@ -251,6 +252,8 @@ js_defaults: &js_defaults
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:8
|
- image: circleci/node:8
|
||||||
|
environment:
|
||||||
|
- PATH: "/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
|
||||||
android_defaults: &android_defaults
|
android_defaults: &android_defaults
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
@ -258,6 +261,7 @@ android_defaults: &android_defaults
|
||||||
- image: circleci/android:api-26-alpha
|
- image: circleci/android:api-26-alpha
|
||||||
resource_class: "large"
|
resource_class: "large"
|
||||||
environment:
|
environment:
|
||||||
|
- PATH: "/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
- TERM: "dumb"
|
- TERM: "dumb"
|
||||||
- ADB_INSTALL_TIMEOUT: 10
|
- ADB_INSTALL_TIMEOUT: 10
|
||||||
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
|
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
|
||||||
|
@ -539,7 +543,7 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
# GITHUB_TOKEN=eslint-bot public_repo access token
|
# GITHUB_TOKEN=eslint-bot public_repo access token
|
||||||
if [ -n "$CIRCLE_PR_NUMBER" ]; then
|
if [ -n "$CIRCLE_PR_NUMBER" ]; then
|
||||||
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
|
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
|
||||||
else
|
else
|
||||||
echo "Skipping code analysis."
|
echo "Skipping code analysis."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
# check status
|
||||||
|
STATUS=$?
|
||||||
|
if [ $STATUS == 0 ]; then
|
||||||
|
echo "Code analyzed successfully"
|
||||||
|
else
|
||||||
|
echo "Code analyzis failed, error status $STATUS"
|
||||||
|
fi
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# execute command
|
||||||
|
$@
|
||||||
|
|
||||||
|
# check status
|
||||||
|
STATUS=$?
|
||||||
|
if [ $STATUS == 0 ]; then
|
||||||
|
echo "Command '$@' completed successfully"
|
||||||
|
else
|
||||||
|
echo "Command '$@' exited with error status $STATUS"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue