@@ -107,13 +107,6 @@ aliases:
107107 - /.*-stable/
108108 - gh-pages
109109
110- - &filter-only-tagged-releases
111- tags :
112- only : /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/
113- branches :
114- only :
115- - /.*-stable/
116-
117110 # Dependency Management
118111 - &install-ndk
119112 name : Install Android NDK
@@ -466,11 +459,9 @@ jobs:
466459 - run :
467460 name : Build iOS app for simulator
468461 command : yarn run build-ios-e2e
469- # TODO: Fix these failing tests.
470- - run : *display-broken-tests-warning
471462 - run :
472- name : Run Detox Tests (Disabled)
473- command : ./scripts/circleci/exec_author_check.sh yarn run test-ios-e2e
463+ name : Run Detox Tests
464+ command : yarn run test-ios-e2e
474465
475466 # Set up an Android environment for downstream jobs
476467 test_android :
@@ -548,59 +539,78 @@ jobs:
548539 # Issues will be posted to the PR itself via GitHub bots.
549540 # This workflow should only fail if the bots fail to run.
550541 analyze_pr :
551- << : *js_defaults
542+ << : *defaults
543+ docker :
544+ - image : circleci/node:10
545+ environment :
546+ - PATH : " /opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
552547 steps :
553- - attach_workspace :
554- at : ~/react-native
548+ - checkout
549+ - run : *setup-artifacts
555550
556- - restore-cache : *restore-cache-analysis
551+ - restore-cache : *restore-yarn-cache
557552 - run : *yarn
553+
558554 - run :
559- name : Install Additional Dependencies
555+ name : Analyze Code
560556 command : |
557+ # GITHUB_TOKEN=eslint-bot public_repo access token
561558 if [ -n "$CIRCLE_PR_NUMBER" ]; then
562- yarn add github@0.2.4
563- cd bots
564- yarn install --non-interactive --cache-folder ~/.cache/yarn
559+ echo -e "\\x1B[36mInstalling additional dependencies\\x1B[0m"; yarn add @octokit/rest@15.10.0
560+ echo -e "\\x1B[36mAnalyzing code\\x1B[0m"; GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" ./scripts/circleci/analyze_code.sh
565561 else
566- echo "Skipping dependency installation ."
562+ echo "Skipping code analysis ."
567563 fi
568- - save-cache : *save-cache-analysis
564+ when : always
569565
566+ - restore-cache : *restore-cache-analysis
570567 - run :
571568 name : Analyze Pull Request
572569 command : |
573570 # DANGER_GITHUB_API_TOKEN=React-Linter public_repo access token
574571 if [ -n "$CIRCLE_PR_NUMBER" ]; then
575- cd bots && DANGER_GITHUB_API_TOKEN="80aa64c50f38a267e9ba""575d41d528f9c234edb8" yarn danger
572+ cd bots
573+ yarn install --non-interactive --cache-folder ~/.cache/yarn
574+ DANGER_GITHUB_API_TOKEN="80aa64c50f38a267e9ba""575d41d528f9c234edb8" yarn danger
576575 else
577576 echo "Skipping pull request analysis."
578577 fi
579578 when : always
580- - run :
581- name : Analyze Code
582- command : |
583- # GITHUB_TOKEN=eslint-bot public_repo access token
584- if [ -n "$CIRCLE_PR_NUMBER" ]; then
585- 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
586- else
587- echo "Skipping code analysis."
588- fi
589- when : always
579+ - save-cache : *save-cache-analysis
590580
591581 # Publishes new version onto npm
592582 # Only works on stable branches when a properly tagged commit is pushed
593- publish :
583+ publish_npm_package :
594584 << : *android_defaults
595585 steps :
596586 - checkout
597587
598588 - restore-cache : *restore-yarn-cache
599589 - run : *yarn
600590
601- - run :
602- name : Authenticate with npm
603- command : echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
591+ # Configure Android SDK and related dependencies
592+ - run : *configure-android-path
593+ - run : *install-android-build-dependencies
594+
595+ - restore-cache : *restore-cache-android-packages
596+ - run : *install-android-packages
597+
598+ # Install Android NDK
599+ - run : *create-ndk-directory
600+ - restore-cache : *restore-cache-ndk
601+ - run : *install-ndk
602+
603+ # Fetch dependencies using Buck
604+ - restore-cache : *restore-cache-downloads-buck
605+ - run : *install-buck
606+ - run : *download-dependencies-buck
607+
608+ # Fetch dependencies using Gradle
609+ - restore-cache : *restore-cache-downloads-gradle
610+ - run : *download-dependencies-gradle
611+
612+ - restore-cache : *restore-yarn-cache
613+ - run : *yarn
604614
605615 - run :
606616 name : Authenticate with npm
@@ -660,39 +670,19 @@ workflows:
660670 requires :
661671 - checkout_code
662672
663- # Only runs on PRs
664- analyze :
665- jobs :
666- # Checkout repo and run Yarn
667- - checkout_code :
668- filters : *filter-ignore-master-stable
669-
670- # Run code checks
671- - analyze_pr :
672- filters : *filter-ignore-master-stable
673- requires :
674- - checkout_code
675-
676- test-and-deploy :
677- jobs :
678- - checkout_code :
679- # required since `publish` has tag filters
680- filters : *filter-only-tagged-releases
681- - test_javascript :
682- requires :
683- - checkout_code
684- - test_objc :
685- requires :
686- - checkout_code
687- - test_android :
688- requires :
689- - checkout_code
690-
691673 # Only runs on vX.X.X tags if all tests are green
692- - publish :
674+ - publish_npm_package :
675+ filters :
676+ branches :
677+ only :
678+ - /.*-stable/
679+ tags :
680+ only : /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/
693681 requires :
694682 - test_javascript
695683 - test_objc
696684 - test_android
697- filters : *filter-only-tagged-releases
698685
686+ # Run code checks
687+ - analyze_pr :
688+ filters : *filter-ignore-master-stable
0 commit comments