From 3f29d2c4403f272264b829b5ecb2d8b49177b01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= <165856+hramos@users.noreply.github.com> Date: Fri, 15 Jun 2018 11:34:19 -0700 Subject: [PATCH] Skip metro bump commits (#19680) 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 https://github.com/facebook/react-native/pull/19680 Differential Revision: D8450638 Pulled By: hramos fbshipit-source-id: 436c229d09bfb4f9f92236c5aeec4a60d8317922 --- .circleci/config.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 663c678228ca6a..1985e9c89de4c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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