Skip to content

Commit

Permalink
Merge branch 'main' into feature/line-break-strategy-ios
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 authored Feb 9, 2022
2 parents b637b07 + 97064ae commit 66d2ce9
Show file tree
Hide file tree
Showing 353 changed files with 10,384 additions and 11,628 deletions.
150 changes: 113 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ executors:
<<: *defaults
docker:
# Note: Version set separately for Windows builds, see below.
- image: circleci/node:14
- image: circleci/node:16
nodeprevlts:
<<: *defaults
docker:
- image: circleci/node:12
- image: circleci/node:14
reactnativeandroid:
<<: *defaults
docker:
Expand Down Expand Up @@ -354,10 +354,6 @@ jobs:
description: Specifies whether unit tests should run.
type: boolean
default: false
run_detox_tests:
description: Specifies whether Detox e2e tests should run.
type: boolean
default: false
run_disabled_tests:
description: Specifies whether disabled tests should run. Set this to true to debug failing tests.
type: boolean
Expand All @@ -380,7 +376,7 @@ jobs:
- run:
name: Configure Environment Variables
command: |
echo 'export PATH=/usr/local/opt/node@14/bin:$PATH' >> $BASH_ENV
echo 'export PATH=/usr/local/opt/node@16/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- with_brew_cache_span:
Expand All @@ -397,7 +393,7 @@ jobs:
name: Configure Node
# Sourcing find-node.sh will ensure nvm is set up.
# It also helps future invocation of find-node.sh prevent permission issue with nvm.sh.
command: source scripts/find-node.sh && nvm install 14 && nvm alias default 14
command: source scripts/find-node.sh && nvm install 16 && nvm alias default 16

- run:
name: Configure Watchman
Expand Down Expand Up @@ -435,13 +431,6 @@ jobs:
- run:
name: "Run Tests: iOS Unit and Integration Tests"
command: yarn test-ios
# Runs iOS Detox e2e tests
- when:
condition: << parameters.run_detox_tests >>
steps:
- run:
name: "Run Tests: Detox iOS End-to-End Tests"
command: yarn run build-ios-e2e && yarn run test-ios-e2e

# Optionally, run disabled tests
- when:
Expand Down Expand Up @@ -599,6 +588,23 @@ jobs:
name: Build the template application
command: cd template/android/ && ./gradlew assembleDebug

# -------------------------
# JOBS: Test Android RNTester
# -------------------------
test_android_rntester:
executor: reactnativeandroid
steps:
- checkout
- run_yarn

- run:
name: Generate artifacts for Maven
command: ./gradlew :ReactAndroid:installArchives

- run:
name: Assemble RNTester
command: ./gradlew :packages:rn-tester:android:app:assembleDebug

# -------------------------
# JOBS: Test iOS Template
# -------------------------
Expand Down Expand Up @@ -632,6 +638,40 @@ jobs:
-scheme $PROJECT_NAME \
-sdk iphonesimulator
# -------------------------
# JOBS: Test iOS RNTester
# -------------------------
test_ios_rntester:
executor: reactnativeios
parameters:
use_hermes:
type: boolean
default: false
steps:
- checkout
- run_yarn

- when:
condition: << parameters.use_hermes >>
steps:
- run:
name: Set USE_HERMES=1
command: echo "export USE_HERMES=1" >> $BASH_ENV

- run:
name: Install CocoaPods dependencies
command: |
rm -rf packages/rn-tester/Pods
cd packages/rn-tester && bundle exec pod install
- run:
name: Build RNTester
command: |
xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
# -------------------------
# JOBS: Windows
# -------------------------
Expand All @@ -655,8 +695,8 @@ jobs:
name: Install Node
# Note: Version set separately for non-Windows builds, see above.
command: |
nvm install 14.17.0
nvm use 14.17.0
nvm install 16
nvm use 16
# Setup Dependencies
- run:
Expand Down Expand Up @@ -744,6 +784,12 @@ jobs:
# JOBS: Releases
# -------------------------
prepare_package_for_release:
parameters:
version:
type: string
latest:
type: boolean
default: false
executor: reactnativeios
steps:
- checkout
Expand All @@ -754,7 +800,7 @@ jobs:
- run:
name: "Set new react-native version and commit changes"
command: |
node ./scripts/prepare-package-for-release.js
node ./scripts/prepare-package-for-release.js -v << parameters.version >> -l << parameters.latest >>
build_npm_package:
parameters:
Expand Down Expand Up @@ -838,13 +884,35 @@ jobs:
command: |
echo "Nightly build run"
# -------------------------
# PIPELINE PARAMETERS
# -------------------------
parameters:
run_package_release_workflow_only:
default: false
type: boolean

release_latest:
default: false
type: boolean

release_version:
default: "9999"
type: string

# -------------------------
# WORK FLOWS
#
# When creating a new workflow, make sure to include condition `unless: << pipeline.parameters.run_package_release_workflow_only >>`
# It's setup this way so we can trigger a release via a POST
# See limitations: https://support.circleci.com/hc/en-us/articles/360050351292-How-to-trigger-a-workflow-via-CircleCI-API-v2
# -------------------------
workflows:
version: 2

tests:
unless: << pipeline.parameters.run_package_release_workflow_only >>
jobs:
- build_npm_package:
# Build a release package on every untagged commit, but do not publish to npm.
Expand All @@ -868,12 +936,27 @@ workflows:
filters:
branches:
ignore: gh-pages
- test_android_rntester:
filters:
branches:
ignore: gh-pages
- test_ios_template:
requires:
- build_npm_package
filters:
branches:
ignore: gh-pages
- test_ios_rntester:
name: test_ios_rntester_hermes
use_hermes: true
filters:
branches:
ignore: gh-pages
- test_ios_rntester:
name: test_ios_rntester_jsc
filters:
branches:
ignore: gh-pages
- test_ios:
name: test_ios_unit_jsc
run_unit_tests: true
Expand All @@ -898,15 +981,6 @@ workflows:
# use_hermes: true
# use_frameworks: true
# run_unit_tests: true
# DISABLED: Detox tests need to be fixed
# - test_ios:
# name: test_ios_detox
# run_detox_tests: true
# DISABLED: USE_FRAMEWORKS=1 not supported by Flipper
# - test_ios:
# name: test_ios_detox_frameworks
# use_frameworks: true
# run_detox_tests: true
- test_js:
name: test_js_prev_lts
executor: nodeprevlts
Expand All @@ -919,20 +993,20 @@ workflows:
ignore: gh-pages
run_disabled_tests: false

releases:
# This workflow should only be triggered by release script
package_release:
when: << pipeline.parameters.run_package_release_workflow_only >>
jobs:
# This job will trigger on relevant release branch pushes.
# It prepares the package and triggers `build_npm_package` for release
# This job will trigger publish_release workflow
- prepare_package_for_release:
name: prepare_package_for_release
# Since CircleCI does not support branch AND tag filters, we manually check in job
# and no-op if there is no `publish-v{version}` tag set.
filters:
branches:
only:
- /^(\d+)\.(\d+)-stable$/
version: << pipeline.parameters.release_version >>
latest : << pipeline.parameters.release_latest >>

# This job will trigger when a version tag is pushed (by prepare_package_for_release)
publish_release:
unless: << pipeline.parameters.run_package_release_workflow_only >>
jobs:
# This job will trigger when a version tag is pushed (by package_release)
- build_npm_package:
name: build_and_publish_npm_package
context: react-native-bot
Expand All @@ -950,6 +1024,7 @@ workflows:
only: /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/

analysis:
unless: << pipeline.parameters.run_package_release_workflow_only >>
jobs:
# Run lints on every commit other than those to the gh-pages branch
- analyze_code:
Expand All @@ -970,6 +1045,7 @@ workflows:
ignore: gh-pages

nightly:
unless: << pipeline.parameters.run_package_release_workflow_only >>
triggers:
- schedule:
cron: "0 20 * * *"
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ untyped-import
untyped-type-import

[version]
^0.168.0
^0.171.0
2 changes: 1 addition & 1 deletion .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ untyped-import
untyped-type-import

[version]
^0.168.0
^0.171.0
26 changes: 0 additions & 26 deletions .github/stale.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/apply-version-label-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Apply version label to issue

on:
issues:
types: [opened, edited]

jobs:
add-version-label-issue:
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: react-native-community/actions-apply-version-label@v0.0.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
required-label: "Type: Upgrade Issue"
3 changes: 1 addition & 2 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ rn_xplat_cxx_library2(
"//fbobjc/Libraries/FBQPLMetadataProviders/...",
"//fbobjc/Libraries/FBReactKit/...",
"//fbobjc/Libraries/FBiOSSecurityUtils/...",
"//fbobjc/Libraries/RCTPrerendering/...",
"//fbobjc/VendorLib/react-native-maps:react-native-maps",
"//xplat/js:",
"//xplat/js/react-native-github/React/...",
Expand Down Expand Up @@ -723,13 +724,11 @@ rn_library(
"//xplat/js:node_modules__abort_19controller",
"//xplat/js:node_modules__anser",
"//xplat/js:node_modules__base64_19js",
"//xplat/js:node_modules__deprecated_19react_19native_19prop_19types",
"//xplat/js:node_modules__event_19target_19shim",
"//xplat/js:node_modules__invariant",
"//xplat/js:node_modules__nullthrows",
"//xplat/js:node_modules__pretty_19format",
"//xplat/js:node_modules__promise",
"//xplat/js:node_modules__prop_19types",
"//xplat/js:node_modules__react_19devtools_19core",
"//xplat/js:node_modules__react_19refresh",
"//xplat/js:node_modules__react_19shallow_19renderer",
Expand Down
Loading

0 comments on commit 66d2ce9

Please sign in to comment.