Skip to content

Commit

Permalink
Merge branch 'master' into randomize-bundle-name
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis authored Oct 14, 2017
2 parents 2bc5d3e + 720a99a commit 804038c
Show file tree
Hide file tree
Showing 77 changed files with 1,168 additions and 495 deletions.
194 changes: 138 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
aliases:
- &restore-cache
- &restore-node-cache
keys:
- v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}
- v1-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
# Fallback in case checksum fails
- v1-dependencies-{{ .Branch }}-
- &save-cache
- v1-dependencies-{{ arch }}-{{ .Branch }}-

- &save-node-cache
paths:
- node_modules
key: v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}
key: v1-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}

- &restore-cache-website
keys:
- v1-website-dependencies-{{ .Branch }}-{{ checksum "website/package.json" }}
- v1-website-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "website/package.json" }}
# Fallback in case checksum fails
- v1-website-dependencies-{{ .Branch }}-
- v1-website-dependencies-{{ arch }}-{{ .Branch }}-

- &save-cache-website
paths:
- website/node_modules
key: v1-website-dependencies-{{ .Branch }}-{{ checksum "website/package.json" }}
key: v1-website-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "website/package.json" }}

- &restore-cache-danger
keys:
- v1-danger-dependencies-{{ .Branch }}-{{ checksum "danger/package.json" }}
- v1-danger-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "danger/package.json" }}
# Fallback in case checksum fails
- v1-danger-dependencies-{{ .Branch }}-
- v1-danger-dependencies-{{ arch }}-{{ .Branch }}-

- &save-cache-danger
paths:
- danger/node_modules
key: v1-danger-dependencies-{{ .Branch }}-{{ checksum "danger/package.json" }}
key: v1-danger-dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "danger/package.json" }}

- &restore-cache-android-packages
keys:
- v1-android-sdkmanager-packages-{{ checksum "scripts/circle-ci-android-setup.sh" }}
- v1-android-sdkmanager-packages-{{ arch }}-{{ checksum "scripts/circle-ci-android-setup.sh" }}
# Fallback in case checksum fails
- v1-android-sdkmanager-packages-
- v1-android-sdkmanager-packages-{{ arch }}-
- &save-cache-android-packages
paths:
- /opt/android/sdk/system-images/android-23
Expand All @@ -43,89 +46,152 @@ aliases:
- /opt/android/sdk/platforms/android-19
- /opt/android/sdk/build-tools/23.0.1
- /opt/android/sdk/add-ons/addon-google_apis-google-23
key: v1-android-sdkmanager-packages-{{ checksum "scripts/circle-ci-android-setup.sh" }}
key: v1-android-sdkmanager-packages-{{ arch }}-{{ checksum "scripts/circle-ci-android-setup.sh" }}

- &restore-cache-ndk
keys:
- v1-android-ndk-r10e-32-64
- v1-android-ndk-{{ arch }}-r10e-32-64

- &save-cache-ndk
paths:
- /opt/ndk
key: v1-android-ndk-r10e-32-64
key: v1-android-ndk-{{ arch }}-r10e-32-64

- &restore-cache-buck-downloads
keys:
- v1-buck-downloads-{{ .Branch }}-{{ checksum "ReactAndroid/build.gradle" }}
- v1-buck-downloads-{{ arch }}-{{ .Branch }}-{{ checksum "ReactAndroid/build.gradle" }}
# Fallback in case checksum fails
- v1-buck-downloads-{{ .Branch }}-
- v1-buck-downloads-{{ arch }}-{{ .Branch }}-
- &save-cache-buck-downloads
paths:
- "ReactAndroid/build/downloads"
key: v1-buck-downloads-{{ .Branch }}-{{ checksum "ReactAndroid/build.gradle" }}
key: v1-buck-downloads-{{ arch }}-{{ .Branch }}-{{ checksum "ReactAndroid/build.gradle" }}

- &restore-cache-buck
keys:
- v1-buck-v2017.09.04.02
- v1-buck-{{ arch }}-v2017.09.04.02
- &save-cache-buck
paths:
- ~/buck
key: v1-buck-v2017.09.04.02
key: v1-buck-{{ arch }}-v2017.09.04.02

- &restore-cache-watchman
keys:
- v1-watchman-v4.9.0
- v1-watchman-{{ arch }}-v4.9.0
- &save-cache-watchman
paths:
- ~/watchman
key: v1-watchman-v4.9.0
key: v1-watchman-{{ arch }}-v4.9.0

- &install-node-dependencies
|
npm install --no-package-lock --no-spin --no-progress

- &run-node-tests
|
npm test -- --maxWorkers=2
npm run lint
npm run flow -- check

defaults: &defaults
working_directory: ~/react-native

version: 2
jobs:
test-node-8:

# Runs unit tests on Node 8
test-js-node-8:
<<: *defaults
docker:
- image: circleci/node:8
steps:
- checkout
- run: npm install --no-package-lock
- run: |
npm run lint
npm run flow -- check
npm test -- --maxWorkers=2
# eslint
- run:
name: Analyze Code
command: |
npm install github@0.2.4
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- 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
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run: *run-node-tests

test-node-6:
# Runs unit tests on Node 6
test-js-node-6:
<<: *defaults
docker:
- image: circleci/node:6.11.0
steps:
- checkout
- run: npm install
- run: |
npm run lint
npm run flow -- check
npm test -- --maxWorkers=2
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run: *run-node-tests

test-node-4:
# Runs unit tests on Node 4
test-js-node-4:
<<: *defaults
docker:
- image: circleci/node:4.8.4
steps:
- checkout
- run: npm install
- run: |
npm run lint
npm run flow -- check
npm test -- --maxWorkers=2
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run: *run-node-tests

# Runs unit tests on iOS devices
test-objc-ios:
<<: *defaults
macos:
xcode: "9.0"
dependencies:
pre:
- xcrun instruments -w "iPhone 5s (10.3.1)" || true
steps:
- checkout
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run: ./scripts/objc-test-ios.sh

# Runs unit tests on tvOS devices
test-objc-tvos:
<<: *defaults
macos:
xcode: "9.0"
dependencies:
pre:
- xcrun instruments -w "Apple TV 1080p (10.0)" || true
steps:
- checkout
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run: ./scripts/objc-test-tvos.sh

# Runs end to end tests
test-objc-e2e:
<<: *defaults
macos:
xcode: "9.0"
dependencies:
pre:
- xcrun instruments -w "iPhone 5s (10.3.1)" || true
steps:
- checkout
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run: node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3;

# Checks podspec
test-podspec:
<<: *defaults
macos:
xcode: "9.0"
steps:
- checkout
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run: ./scripts/process-podspecs.sh

test-website:
<<: *defaults
docker:
Expand Down Expand Up @@ -177,7 +243,9 @@ jobs:
- image: circleci/node:8
steps:
- checkout
- run: npm install --no-package-lock
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- run:
name: Build JavaScript Bundle
command: node local-cli/cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
Expand Down Expand Up @@ -254,7 +322,10 @@ jobs:
command: |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
- run: npm install
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
# TODO: Install and use watchman to speed up builds
# - restore-cache: *restore-cache-watchman
# - run:
# name: Install Watchman Dependencies
Expand Down Expand Up @@ -318,11 +389,11 @@ jobs:
- run:
name: Build and Install Test APK
command: source scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
# Failing test is expected
# TODO: Uncomment, test was already failing on Circle 1.0
# - run:
# name: Run Installed APK with Tests
# command: node ./scripts/run-android-ci-instrumentation-tests.js --retries 3 --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests
# Should be disabled pending on https://our.intern.facebook.com/intern/tasks?t=16912142
# TODO: Should be disabled, pending on https://our.intern.facebook.com/intern/tasks?t=16912142
# - run:
# name: Run Android End to End Tests
# command: source scripts/circle-ci-android-setup.sh && retry3 node ./scripts/run-ci-e2e-tests.js --android --js --retries 2
Expand All @@ -334,7 +405,7 @@ jobs:
mkdir -p ~/junit/
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ~/junit/ \;
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ~/junit/ \;
# TODO circle does not understand Buck's report, maybe need to transform xml slightly
# TODO: Circle does not understand Buck's report, maybe need to transform xml slightly
# find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} ~/junit/ \;
when: always
- store_test_results:
Expand All @@ -345,12 +416,14 @@ jobs:
# Workflows enables us to run multiple jobs in parallel
workflows:
version: 2

test_node:
jobs:
- test-node-8
- test-node-6
# Node 4 tests are already failing on Circle 1.0
# - test-node-4
- test-js-node-8
- test-js-node-6
# TODO: Node 4 tests are already failing on Circle 1.0
# - test-js-node-4

website:
jobs:
- test-website
Expand All @@ -362,6 +435,7 @@ workflows:
only:
- /.*-stable/
- master

test_android:
jobs:
- build-js-bundle:
Expand All @@ -371,3 +445,11 @@ workflows:
- test-android:
requires:
- build-js-bundle

test_ios:
jobs:
- test-objc-ios
- test-objc-tvos
# TODO: Podspec tests are already failing on Travis
# - test-podspec
- test-objc-e2e
6 changes: 3 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.56.0
^0.57.0
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,38 @@ Happy contributing!
-->

## Motivation

(Write your motivation here.)

## Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

## Release Notes
<!--
Help reviewers and the release process by writing your own release notes
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAl ] [ BUGFIX ] [-{Component}-]
[ INTERNAL ] [ ENHANCEMENT ] [ {File} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
[CATEGORY] [TYPE] [LOCATION] - MESSAGE
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
9 changes: 9 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14
# Label requiring a response
responseRequiredLabel: Needs more information
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
Closing this issue as more information is needed to debug this and we have not heard back from the author.
Loading

0 comments on commit 804038c

Please sign in to comment.