1
- # Orb support is from version >= 2.1
2
1
version : 2.1
3
2
4
- # Make sure you use the latest version of the Orb!
5
3
orbs :
6
4
rn :
react-native-community/[email protected]
7
5
8
- # Custom jobs which are not part of the Orb
9
- jobs :
10
- checkout_code :
11
- executor : rn/linux_js
6
+ executors :
7
+ default :
8
+ docker :
9
+ - image : circleci/node:10
10
+ working_directory : ~/project
11
+
12
+ commands :
13
+ attach_project :
12
14
steps :
13
- - checkout
14
- - persist_to_workspace :
15
- root : .
16
- paths :
17
- - .
15
+ - attach_workspace :
16
+ at : ~/project
17
+
18
+ jobs :
18
19
install-dependencies :
19
- executor : rn/linux_js
20
+ executor : default
20
21
steps :
21
- - attach_workspace :
22
- at : .
22
+ - checkout
23
+ - attach_project
23
24
- restore_cache :
24
25
keys :
25
26
- dependencies-{{ checksum "package.json" }}
@@ -35,49 +36,106 @@ jobs:
35
36
yarn install --frozen-lockfile
36
37
- save_cache :
37
38
key : dependencies-{{ checksum "package.json" }}
38
- paths :
39
- - node_modules
39
+ paths : node_modules
40
40
- save_cache :
41
41
key : dependencies-example-{{ checksum "example/package.json" }}
42
- paths :
43
- - example/node_modules
42
+ paths : example/node_modules
44
43
- persist_to_workspace :
45
44
root : .
46
- paths :
47
- - .
48
- analyse_js :
49
- executor : rn/linux_js
45
+ paths : .
46
+
47
+ lint :
48
+ executor : default
49
+ steps :
50
+ - attach_project
51
+ - run :
52
+ name : Lint files
53
+ command : |
54
+ yarn lint
55
+ typescript :
56
+ executor : default
57
+ steps :
58
+ - attach_project
59
+ - run :
60
+ name : Typecheck files
61
+ command : |
62
+ yarn typescript
63
+ e2e_release_ios :
64
+ executor :
65
+ name : rn/macos
66
+ xcode_version : ' 11.4.0'
50
67
steps :
51
68
- attach_workspace :
52
69
at : .
53
- - rn/yarn_install
70
+ - rn/setup_macos_executor :
71
+ node_version : ' 12.10.0'
72
+ - rn/ios_simulator_start :
73
+ device : ' iPhone 11'
74
+ - rn/pod_install :
75
+ pod_install_directory : ' example/ios'
76
+ - run :
77
+ command : yarn --cwd example detox:ios:build:release
78
+ name : build for detox
54
79
- run :
55
- name : Run ESLint
56
- command : yarn lint
80
+ command : detox clean-framework-cache && detox build-framework-cache && yarn --cwd example detox:ios:test:release
81
+ name : test detox
82
+ - store_artifacts :
83
+ path : ./example/artifacts
84
+ e2e_release_android :
85
+ # we need to use mac to run emulator with acceleration
86
+ # see https://support.circleci.com/hc/en-us/articles/360000028928-Testing-with-Android-emulator-on-CircleCI-2-0
87
+ executor :
88
+ name : rn/macos
89
+ xcode_version : ' 11.4.0'
90
+ steps :
91
+ - attach_workspace :
92
+ at : .
93
+ - rn/setup_macos_executor :
94
+ node_version : ' 12.10.0'
95
+ - rn/android_emulator_start :
96
+ logcat_grep : ' com.example.reactnativepagerview'
97
+ platform_version : ' android-29'
57
98
- run :
58
- name : Typescript
59
- command : yarn typescript
99
+ command : yarn --cwd example detox:android:build:release
100
+ name : build for detox
101
+ - run :
102
+ command : yarn --cwd example detox:android:test:release
103
+ name : test detox
104
+ - store_artifacts :
105
+ path : ./example/artifacts
106
+ unit-tests :
107
+ executor : default
108
+ steps :
109
+ - attach_project
110
+ - run :
111
+ name : Run unit tests
112
+ command : |
113
+ yarn test --coverage
114
+ - store_artifacts :
115
+ path : coverage
116
+ destination : coverage
60
117
118
+ build-package :
119
+ executor : default
120
+ steps :
121
+ - attach_project
122
+ - run :
123
+ name : Build package
124
+ command : |
125
+ yarn prepare
61
126
workflows :
62
- test :
127
+ build-and- test :
63
128
jobs :
64
- # Checkout the code and persist to the Workspace
65
- # Note: This is a job which is defined above and not part of the Orb
66
- - checkout_code
67
- - install-dependencies :
129
+ - install-dependencies
130
+ - lint :
68
131
requires :
69
- - checkout_code
70
-
71
- # Analyze the Javascript using ESLint, Flow, and Jest
72
- # Note: This is a job which is defined above and not part of the Orb
73
- - analyse_js :
132
+ - install-dependencies
133
+ - typescript :
74
134
requires :
75
135
- install-dependencies
76
-
77
- # Build the Android app in debug mode
78
- - rn/android_build :
79
- name : build_android
80
- project_path : " example/android"
81
- build_type : debug
136
+ - e2e_release_ios :
137
+ requires :
138
+ - install-dependencies
139
+ - e2e_release_android :
82
140
requires :
83
- - analyse_js
141
+ - install-dependencies
0 commit comments