Skip to content

Commit

Permalink
Skip metro bump commits (#19680)
Browse files Browse the repository at this point in the history
Summary:
New metro releases are published to npm when a "Bump metro" commit is synced to GitHub and picked up by facebook/metro's Circle CI.
The same commit is picked up by facebook/react-native's Circle CI, but it will fail the checkout job because yarn will not find the new package on npm.
This is expected because the package will only be published to npm after Circle CI is done running on facebook/metro.

We can safely skip `yarn install` on these commits, and rely on the restored yarn cache instead.
Closes #19680

Differential Revision: D8450638

Pulled By: hramos

fbshipit-source-id: 436c229d09bfb4f9f92236c5aeec4a60d8317922
  • Loading branch information
hramos authored and facebook-github-bot committed Jun 15, 2018
1 parent dc0ebf7 commit 3f29d2c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,13 @@ aliases:
command: source scripts/android-setup.sh && getAndroidNDK

- &yarn
|
yarn install --non-interactive --cache-folder ~/.cache/yarn
name: Run Yarn
command: |
# Skip yarn install on metro bump commits as the package is not yet
# available on npm
if [[ $(echo "$GIT_COMMIT_DESC" | grep -c "Bump metro@") -eq 0 ]]; then
yarn install --non-interactive --cache-folder ~/.cache/yarn
fi
- &install-yarn
name: Install Yarn
Expand Down Expand Up @@ -304,6 +309,8 @@ aliases:

defaults: &defaults
working_directory: ~/react-native
environment:
- GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1

js_defaults: &js_defaults
<<: *defaults
Expand Down

0 comments on commit 3f29d2c

Please sign in to comment.