From bbde55ee11544a59005cc8c33e87ee3bbda354b3 Mon Sep 17 00:00:00 2001 From: James Treanor Date: Thu, 25 Jul 2019 11:42:49 -0700 Subject: [PATCH] Test RNTesterPods on CI with use_frameworks! enabled (#25818) Summary: This adds a `test_ios_frameworks` job to CircleCI to test the `RNTesterPods` project with `use_frameworks!` enabled. It will ensure the issue in https://github.com/facebook/react-native/issues/25349 is not reintroduced as suggested in https://github.com/facebook/react-native/pull/25619#issuecomment-514380653. ## Changelog [iOS] [Internal] - Added CircleCI job for testing `RNTesterPods` with `use_frameworks!` enabled. Pull Request resolved: https://github.com/facebook/react-native/pull/25818 Test Plan: Tests seem to be failing on `master` at the moment but you can see that the new job builds successfully [here](https://circleci.com/gh/facebook/react-native/103929?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link). You can confirm it installs the pods with `use_frameworks!` by seeing that `Installing pods with use_frameworks!` is at the start of the log for the `Generate RNTesterPods Workspace` step. Reviewed By: hramos Differential Revision: D16495016 Pulled By: fkgozali fbshipit-source-id: 8ef607cc3a152f599d226f9f45d990fba50a65d4 --- .circleci/config.yml | 26 +++++++++++++++++++++++--- RNTester/Podfile | 8 +++++--- RNTester/Podfile.lock | 2 +- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e46a1045726..7a5d7eeceb8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,15 +122,19 @@ commands: steps: type: steps steps: + - run: + name: Setup CocoaPods cache + # Copy RNTester/Podfile.lock since it can be changed by pod install + command: cp RNTester/Podfile.lock RNTester/Podfile.lock.bak - restore_cache: keys: - - v1-pods-{{ checksum "RNTester/Podfile.lock" }} - - v1-pods- + - v1-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "RNTester/Podfile.lock.bak" }} + - v1-pods-{{ .Environment.CIRCLE_JOB }}- - steps: << parameters.steps >> - save_cache: paths: - RNTester/Pods - key: v1-pods-{{ checksum "RNTester/Podfile.lock" }} + key: v1-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "RNTester/Podfile.lock.bak" }} download_gradle_dependencies: steps: @@ -301,6 +305,10 @@ jobs: # Runs unit tests on iOS devices test_ios: executor: reactnativeios + parameters: + use_frameworks: + type: boolean + default: false environment: - REPORTS_DIR: "./reports" steps: @@ -321,6 +329,13 @@ jobs: command: | curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf + - when: + condition: << parameters.use_frameworks >> + steps: + - run: + name: Set USE_FRAMEWORKS=1 + command: echo "export USE_FRAMEWORKS=1" >> $BASH_ENV + - with_pods_cache_span: steps: - run: @@ -609,6 +624,11 @@ workflows: - test_ios: requires: - setup_ios + - test_ios: + name: test_ios_frameworks + use_frameworks: true + requires: + - setup_ios - test_ios_e2e: requires: - setup_ios diff --git a/RNTester/Podfile b/RNTester/Podfile index 3b45e9afeae..d7fa6188ad4 100644 --- a/RNTester/Podfile +++ b/RNTester/Podfile @@ -2,10 +2,12 @@ platform :ios, '9.0' require_relative '../scripts/autolink-ios' -def pods() - # Uncomment for Swift - # use_frameworks! +if ENV['USE_FRAMEWORKS'] == '1' + puts "Installing pods with use_frameworks!" + use_frameworks! +end +def pods() project 'RNTesterPods.xcodeproj' # Enable TurboModule diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 5295ba74b6c..cab692d2f3f 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -375,6 +375,6 @@ SPEC CHECKSUMS: ReactCommon: 63d1a6355d5810a21a61efda9ac93804571a1b8b yoga: b72aa5b3708cc93c5897f8297122d6eba1331e07 -PODFILE CHECKSUM: f866eab42001b1d59349bce6b20d00912cdc700c +PODFILE CHECKSUM: 060903e270072f1e192b064848e6c34528af1c87 COCOAPODS: 1.7.1