forked from react-native-community/react-native-circleci-orb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add jobs for building and testing
- Loading branch information
1 parent
81f8f67
commit 2f24401
Showing
5 changed files
with
190 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
description: Builds the Android app at the given path with the given build types. | ||
|
||
executor: linux_android | ||
|
||
parameters: | ||
# For this job | ||
checkout: | ||
description: Boolean for whether or not to checkout as a first step. Default is false. | ||
type: boolean | ||
default: false | ||
attach_workspace: | ||
description: Boolean for whether or not to attach to an existing workspace. Default is true. | ||
type: boolean | ||
default: true | ||
workspace_root: | ||
description: Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory). | ||
type: string | ||
default: . | ||
persist_to_workspace: | ||
description: Should this job persist files to a workspace? Defaults to true | ||
type: boolean | ||
default: true | ||
store_artifacts: | ||
description: Store this job store files as job artifacts? Defaults to true | ||
type: boolean | ||
default: true | ||
# For the build command | ||
project_path: | ||
description: The path to the root of the Android project you want to build, relative to the root of the repository. | ||
type: string | ||
default: "./android" | ||
build_type: | ||
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app. | ||
type: string | ||
default: "debug" | ||
|
||
steps: | ||
- when: | ||
condition: <<parameters.checkout>> | ||
steps: | ||
- checkout | ||
- when: | ||
condition: <<parameters.attach_workspace>> | ||
steps: | ||
- attach_workspace: | ||
at: <<parameters.workspace_root>> | ||
- yarn_install | ||
- android_build: | ||
project_path: <<parameters.project_path>> | ||
build_type: <<parameters.build_type>> | ||
- when: | ||
condition: <<parameters.persist_to_workspace>> | ||
steps: | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- <<parameters.project_path>>/app/build/outputs/apk | ||
- when: | ||
condition: <<parameters.store_artifacts>> | ||
steps: | ||
- store_artifacts: | ||
path: <<parameters.project_path>>/app/build/outputs/apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
description: Tests the Android app on the given device, with the given Detox configuration. You should have already built the correct Android APK (including the androidTest APK) and have both persisted to the worksapce. | ||
|
||
executor: macos | ||
|
||
parameters: | ||
# For this job | ||
workspace_root: | ||
description: Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory). | ||
type: string | ||
default: . | ||
# For the start emulator command | ||
device_name: | ||
description: The name of the AVD. You use this name to tell which device to run tests on. Defaults to 'TestingAVD'. | ||
type: string | ||
default: "TestingAVD" | ||
platform_version: | ||
description: The version of android to run on the emulator. Defaults to 'android-28'. | ||
type: string | ||
default: "android-28" | ||
build_tools_version: | ||
description: The version of the Android build tools to install. Defaults to '28.0.3'. | ||
type: string | ||
default: "28.0.3" | ||
logcat_grep: | ||
description: ADB logs will be shown in the "Start Android Emulator" commands, but we filter it using grep to avoid noise. You can specify additional strigns to grep for. Make sure you escape special characters. Defaults to 'com.reactnativecommunity'. | ||
type: string | ||
default: "com.reactnativecommunity" | ||
# For the detox command | ||
detox_configuration: | ||
description: The Detox configuration to test. Defaults to 'android.emu.release'. | ||
type: string | ||
default: "android.emu.release" | ||
|
||
steps: | ||
- attach_workspace: | ||
at: <<parameters.workspace_root>> | ||
- setup_macos_executor | ||
- yarn_install | ||
- android_emulator_start: | ||
device_name: <<parameters.device_name>> | ||
platform_version: <<parameters.platform_version>> | ||
build_tools_version: <<parameters.build_tools_version>> | ||
logcat_grep: <<parameters.logcat_grep>> | ||
- detox_test: | ||
configuration: <<parameters.detox_configuration>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
description: Builds the iOS app at the given path with the given build scheme and configuration and then runs the tests with the Detox configuration given. | ||
|
||
executor: macos | ||
|
||
parameters: | ||
# For this job | ||
checkout: | ||
description: Boolean for whether or not to checkout as a first step. Default is false. | ||
type: boolean | ||
default: false | ||
attach_workspace: | ||
description: Boolean for whether or not to attach to an existing workspace. Default is true. | ||
type: boolean | ||
default: true | ||
workspace_root: | ||
description: Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory). | ||
type: string | ||
default: . | ||
# For the iOS build command | ||
project_type: | ||
description: If the iOS app is built using a project file (*.xcodeproj) or a workspace. | ||
type: enum | ||
enum: ["project", "workspace"] | ||
default: "project" | ||
project_path: | ||
description: The path to the Xcode project (*.xcodeproj) or the Xcode workspace (*.xcworkspace) that you want to build, relative to the root of the repository. | ||
type: string | ||
build_configuration: | ||
description: The build configuration to use. This is normally either "Debug" or "Release" but you may have custom build configuration configured for your app. | ||
type: string | ||
default: "Debug" | ||
derived_data_path: | ||
description: The path to the directory to place the derived data, relative to the root of the repository. | ||
type: string | ||
default: "ios/build" | ||
device: | ||
description: The type of device you want to build for. | ||
type: string | ||
default: "iPhone X" | ||
scheme: | ||
description: The scheme to use. | ||
type: string | ||
# For the Detox test command | ||
detox_configuration: | ||
description: The Detox configuration to test. | ||
type: string | ||
default: "ios.sim.release" | ||
|
||
steps: | ||
- when: | ||
condition: <<parameters.checkout>> | ||
steps: | ||
- checkout | ||
- when: | ||
condition: <<parameters.attach_workspace>> | ||
steps: | ||
- attach_workspace: | ||
at: <<parameters.workspace_root>> | ||
- setup_macos_executor | ||
- ios_simulator_start: | ||
device: <<parameters.device>> | ||
- yarn_install | ||
- ios_build: | ||
project_path: <<parameters.project_path>> | ||
derived_data_path: <<parameters.derived_data_path>> | ||
device: <<parameters.device>> | ||
build_configuration: <<parameters.build_configuration>> | ||
scheme: <<parameters.scheme>> | ||
- detox_test: | ||
configuration: <<parameters.detox_configuration>> |