Circle CI: Replace string parameters with enums where applicable (#34962)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34962

For jobs that take a string parameter, where that string parameter is expected to be one of a set of accepted values, use an enum instead.

If an unexpected value is passed to a enum parameter, then `circleci config validate` will flag the issue.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D40310118

fbshipit-source-id: b8416c415705ff6eba80cc5f0d9bfe670569f732
This commit is contained in:
Héctor Ramos 2022-10-13 13:03:45 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 3d64d0916d
Коммит 7f1729a94f
1 изменённых файлов: 23 добавлений и 9 удалений

Просмотреть файл

@ -744,14 +744,18 @@ jobs:
executor: reactnativeandroid
parameters:
flavor:
type: string
default: "Debug"
description: The Android build type. Must be one of "Debug", "Release".
type: enum
enum: ["Debug", "Release"]
newarchitecture:
type: boolean
default: false
jsengine:
type: string
default: "Hermes"
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type: enum
enum: ["Hermes", "JSC"]
environment:
- PROJECT_NAME: "AndroidTemplateProject"
steps:
@ -790,17 +794,25 @@ jobs:
executor: reactnativeios
parameters:
flavor:
type: string
default: "Debug"
description: The Xcode build type. Must be one of "Debug", "Release".
type: enum
enum: ["Debug", "Release"]
architecture:
type: string
default: "OldArch"
description: Which React Native architecture to use. Must be one of "NewArch", "OldArch".
type: enum
enum: ["NewArch", "OldArch"]
jsengine:
type: string
default: "Hermes"
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type: enum
enum: ["Hermes", "JSC"]
flipper:
type: string
default: "WithFlipper"
description: Whether Flipper is enabled. Must be one of "WithFlipper", "WithoutFlipper".
type: enum
enum: ["WithFlipper", "WithoutFlipper"]
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root
@ -878,14 +890,16 @@ jobs:
test_ios_rntester:
executor: reactnativeios
parameters:
architecture:
type: string
default: "OldArch"
jsengine:
default: "Hermes"
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type: enum
enum: ["Hermes", "JSC"]
architecture:
default: "OldArch"
description: Which React Native architecture to use. Must be one of "OldArch", "NewArch".
type: enum
enum: ["NewArch", "OldArch"]
steps:
- checkout_code_with_cache
- run_yarn