Skip to content

Commit

Permalink
Add CircleCI tests for use frameworks (#35497)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #35497

In 0.71.0-RC.2, we had a regression in `use_frameworks!`.

This adds some CircleCI jobs to make sure we do not regress on those. It also updates the template to support these tests.

## Changelog
[iOS][Added] - CircleCI jobs to keep the use_framework! setup in check for the Old Arch

Reviewed By: cortinico

Differential Revision: D41551288

fbshipit-source-id: 531fabb1a7b6aceab2926bb83cf2887129df1776
  • Loading branch information
cipolleschi authored and kelset committed Nov 30, 2022
1 parent c8ef846 commit dbdd973
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,11 @@ jobs:
description: Whether Flipper is enabled. Must be one of "WithFlipper", "WithoutFlipper".
type: enum
enum: ["WithFlipper", "WithoutFlipper"]
use_frameworks:
default: "StaticLibraries"
description: Which kind of option we want to use for `use_frameworks!`
type: enum
enum: ["StaticLibraries", "StaticFrameworks"] #TODO: Add "DynamicFrameworks"
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root
Expand All @@ -845,6 +850,24 @@ jobs:
steps:
- run:
command: circleci-agent step halt # this interrupts the job successfully.
# use_frameworks! does not works with Flipper enabled
- when:
condition:
and:
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
- equal: [ << parameters.flipper >>, "WithFlipper" ]
steps:
- run:
command: circleci-agent step halt # this interrupts the job successfully.
# use_frameworks! does not works with the New Architecture enabled
- when:
condition:
and:
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
- equal: [ << parameters.architecture >>, "NewArch" ]
steps:
- run:
command: circleci-agent step halt # this interrupts the job successfully.
# Valid configuration, we can continue
- checkout_code_with_cache
- run_yarn
Expand Down Expand Up @@ -894,6 +917,10 @@ jobs:
export NO_FLIPPER=1
fi
if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
export USE_FRAMEWORKS=static
fi
bundle exec pod install
- run:
name: Build template project
Expand Down Expand Up @@ -1581,6 +1608,7 @@ workflows:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
flipper: ["WithFlipper", "WithoutFlipper"]
use_frameworks: [ "StaticLibraries", "StaticFrameworks" ] #TODO: make it works with DynamicFrameworks
- test_ios_rntester:
requires:
- build_hermes_macos
Expand Down
6 changes: 6 additions & 0 deletions template/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ prepare_react_native_project!

flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end

target 'HelloWorld' do
config = use_native_modules!

Expand Down

0 comments on commit dbdd973

Please sign in to comment.