1
1
version : 2
2
2
jobs :
3
- test :
3
+ node :
4
+ working_directory : ~/demo-react-native
4
5
docker :
5
- - image : circleci/android:api-28-alpha # gcloud is baked into this image
6
+ - image : circleci/node:8
6
7
steps :
8
+ - checkout
9
+
10
+ - restore_cache :
11
+ key : yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
12
+
13
+ - restore_cache :
14
+ key : node-v1-{{ checksum "package.json" }}-{{ arch }}
15
+
16
+ - run : yarn install
17
+
18
+ - save_cache :
19
+ key : yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
20
+ paths :
21
+ - ~/.cache/yarn
22
+
23
+ - save_cache :
24
+ key : node-v1-{{ checksum "package.json" }}-{{ arch }}
25
+ paths :
26
+ - node_modules
27
+
7
28
- run :
8
- name : Build debug APK and release APK
29
+ name : jest tests
9
30
command : |
10
- ./gradlew :app:assembleDebug
11
- ./gradlew :app:assembleDebugAndroidTest
12
-
31
+ mkdir -p test-results/jest
32
+ yarn run test
33
+ environment :
34
+ JEST_JUNIT_OUTPUT : test-results/jest/junit.xml
35
+
36
+ - persist_to_workspace :
37
+ root : ~/demo-react-native
38
+ paths :
39
+ - node_modules
40
+
41
+ - store_test_results :
42
+ path : test-results
43
+
44
+ - store_artifacts :
45
+ path : test-results
46
+
47
+ android :
48
+ working_directory : ~/demo-react-native/android
49
+ docker :
50
+ - image : circleci/android:api-27-node8-alpha
51
+ steps :
52
+ - checkout :
53
+ path : ~/demo-react-native
54
+
55
+ - attach_workspace :
56
+ at : ~/demo-react-native
57
+
58
+ - restore_cache :
59
+ key : bundle-v1-{{ checksum "Gemfile.lock" }}-{{ arch }}
60
+
61
+ - run : bundle install
62
+
63
+ - save_cache :
64
+ key : bundle-v1-{{ checksum "Gemfile.lock" }}-{{ arch }}
65
+ paths :
66
+ - vendor/bundle
67
+
68
+ - run :
69
+ name : fastlane tests
70
+ command : |
71
+ mkdir -p test-results/fastlane
72
+ bundle exec fastlane test
73
+ mv fastlane/report.xml test-results/fastlane
74
+ - store_test_results :
75
+ path : test-results
76
+
77
+ - store_artifacts :
78
+ path : test-results
79
+
80
+ ios :
81
+ macos :
82
+ xcode : " 9.0"
83
+ working_directory : ~/demo-react-native
84
+
85
+ # use a --login shell so our "set Ruby version" command gets picked up for later steps
86
+ shell : /bin/bash --login -o pipefail
87
+
88
+ steps :
89
+ - checkout
90
+
91
+ - run :
92
+ name : set Ruby version
93
+ command : echo "ruby-2.4" > ~/.ruby-version
94
+
95
+ - restore_cache :
96
+ key : yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
97
+
98
+ - restore_cache :
99
+ key : node-v1-{{ checksum "package.json" }}-{{ arch }}
100
+
101
+ # not using a workspace here as Node and Yarn versions
102
+ # differ between our macOS executor image and the Docker containers above
103
+ - run : yarn install
104
+
105
+ - save_cache :
106
+ key : yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
107
+ paths :
108
+ - ~/.cache/yarn
109
+
110
+ - save_cache :
111
+ key : node-v1-{{ checksum "package.json" }}-{{ arch }}
112
+ paths :
113
+ - node_modules
114
+
115
+ - restore_cache :
116
+ key : bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }}
117
+
118
+ - run :
119
+ command : bundle install
120
+ working_directory : ios
121
+
122
+ - save_cache :
123
+ key : bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }}
124
+ paths :
125
+ - vendor/bundle
126
+
127
+ - run :
128
+ command : bundle exec fastlane test
129
+ working_directory : ios
130
+
131
+ - run :
132
+ name : set up test results
133
+ working_directory : ios
134
+ when : always
135
+ command : |
136
+ mkdir -p test-results/fastlane test-results/xcode
137
+ mv fastlane/report.xml test-results/fastlane
138
+ mv fastlane/test_output/report.junit test-results/xcode/junit.xml
139
+ - store_test_results :
140
+ path : ios/test-results
141
+
142
+ - store_artifacts :
143
+ path : ios/test-results
144
+
145
+ workflows :
146
+ version : 2
147
+ node-android-ios :
148
+ jobs :
149
+ - node
150
+ - android :
151
+ requires :
152
+ - node
153
+ - ios :
154
+ requires :
155
+ - node
0 commit comments