-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathandroid_test.yml
128 lines (125 loc) · 5.01 KB
/
android_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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.
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: .
start_metro:
description: If we should start the Metro packager in the background for this job.
type: boolean
default: false
yarn_cache:
description: Should we cache after yarn install? Defaults to true
type: boolean
default: true
# 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 strings 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"
detox_loglevel:
description: The Detox logging level to use. Must be one of "fatal", "error", "warn", "info", "verbose", or "trace".
type: enum
enum: ["fatal", "error", "warn", "info", "verbose", "trace"]
default: warn
store_artifact_path:
description: Stores detox artifacts at CircleCI
type: string
default: ""
should_on_after_initialize:
description: Set this to true if you want to run a custom shell command right after yarn install. Provide the command in on_after_initialize command.
type: boolean
default: false
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""
should_on_after_emulator_start:
description: Set this to true if you want to run a custom shell command right after the android emulator starts. Provide the command in on_after_emulator_start command.
type: boolean
default: false
on_after_emulator_start:
description: A custom command to run right after the android emulator starts.
type: string
default: ""
# For macos executor
node_version:
description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1").
type: string
default: "16"
homebrew_cache:
description: Should we cache after brew install? Defaults to true
type: boolean
default: true
homebrew_update:
description: Should we run brew update? Defaults to true
type: boolean
default: true
xcode_version:
description: The version of Xcode to use. See here for the list of supported versions https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
type: string
default: "12.5.1"
resource_class:
description: You can use whatever resource class your plan has access to. See https://circleci.com/docs/configuration-reference/#resourceclass
type: string
default: medium
executor:
name: macos
xcode_version: <<parameters.xcode_version>>
resource_class: <<parameters.resource_class>>
steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor:
node_version: <<parameters.node_version>>
homebrew_cache: <<parameters.homebrew_cache>>
homebrew_update: <<parameters.homebrew_update>>
- yarn_install:
cache: <<parameters.yarn_cache>>
- when:
condition: <<parameters.should_on_after_initialize>>
steps:
- run:
name: "on_after_initialize"
command: <<parameters.on_after_initialize>>
- when:
condition: <<parameters.start_metro>>
steps:
- metro_start
- 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>>
- when:
condition: <<parameters.should_on_after_emulator_start>>
steps:
- run:
name: "on_after_emulator_start"
command: <<parameters.on_after_emulator_start>>
- detox_test:
configuration: <<parameters.detox_configuration>>
loglevel: <<parameters.detox_loglevel>>
- when:
condition: <<parameters.store_artifact_path>>
steps:
- store_artifacts:
path: <<parameters.store_artifact_path>>