From 7f1729a94f043dcacac54554a0572b1c33411c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Thu, 13 Oct 2022 13:03:45 -0700 Subject: [PATCH] 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 --- .circleci/config.yml | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f048d3ec5f..150bf233f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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