1
- # -------------------------
2
- # DEFAULTS
3
- # -------------------------
4
- defaults : &defaults
5
- working_directory : ~/react-native-viewpager
6
- environment :
7
- - GIT_COMMIT_DESC : git log --format=oneline -n 1 $CIRCLE_SHA1
1
+ # Orb support is from version >= 2.1
2
+ version : 2.1
8
3
9
- # LINUX
10
- linux_defaults : &linux_defaults
11
- << : *defaults
12
- docker :
13
- - image : circleci/node:8
14
- environment :
15
- - PATH : " /opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4
+ # Make sure you use the latest version of the Orb!
5
+ orbs :
6
+ rn :
react-native-community/[email protected]
16
7
17
- # ANDROID
18
- android_defaults : &android_defaults
19
- << : *defaults
20
- docker :
21
- - image : circleci/android:api-27-node8-alpha
22
- environment :
23
- - TERM : " dumb"
24
- - ADB_INSTALL_TIMEOUT : 10
25
- - _JAVA_OPTIONS : " -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
26
- - GRADLE_OPTS : ' -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
27
- - BUILD_THREADS : 2
28
-
29
- # MACOS
30
- macos_defaults : &macos_defaults
31
- << : *defaults
32
- macos :
33
- xcode : " 10.1.0"
34
-
35
- # -------------------------
36
- # ALIASES
37
- # -------------------------
38
-
39
- aliases :
40
- # CACHE
41
- - &restore-yarn-cache
42
- keys :
43
- - yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
44
- - yarn-cache-{{ arch }}
45
- - &save-yarn-cache
46
- paths :
47
- - ~/.cache/yarn
48
- - ~/Library/Detox/ios
49
- key : yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
50
-
51
- - &restore-gradle-cache
52
- keys :
53
- - gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }}
54
- - &save-gradle-cache
55
- paths :
56
- - ~/.gradle
57
- key : gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }}
58
-
59
- # INSTALLATION
60
- - &yarn
61
- name : Yarn Install
62
- command : |
63
- yarn install --network-concurrency 1 --non-interactive --cache-folder ~/.cache/yarn & wait
64
-
65
- # ANALYSE
66
- - &eslint
67
- name : ESLint Checks
68
- command : yarn lint
69
-
70
- - &flow
71
- name : Flow Checks
72
- command : yarn flow check
73
-
74
- # - &jest
75
- # name: Jest Unit Tests
76
- # command: yarn test:jest
77
-
78
- # -------------------------
79
- # JOBS
80
- # -------------------------
81
- version : 2
8
+ # Custom jobs which are not part of the Orb
82
9
jobs :
83
- # Set up a Linux environment for downstream jobs
84
- linux-checkout :
85
- << : *linux_defaults
10
+ checkout_code :
11
+ executor : rn/linux_js
86
12
steps :
87
13
- checkout
88
- - restore-cache : *restore-yarn-cache
89
- - run : rm -rf node_modules
90
- - run : yarn cache clean
91
- - run : *yarn
92
- - save-cache : *save-yarn-cache
93
14
- persist_to_workspace :
94
15
root : .
95
16
paths : .
96
-
97
- eslint :
98
- << : *linux_defaults
99
- steps :
100
- - attach_workspace :
101
- at : ~/react-native-viewpager
102
- - run : *eslint
103
-
104
- flow :
105
- << : *linux_defaults
17
+ analyse_js :
18
+ executor : rn/linux_js
106
19
steps :
107
20
- attach_workspace :
108
- at : ~/react-native-viewpager
109
- - run : *flow
110
-
111
- # jest:
112
- # <<: *linux_defaults
113
- # steps:
114
- # - attach_workspace:
115
- # at: ~/react-native-viewpager
116
- # - run: *jest
117
-
118
- android-compile :
119
- << : *android_defaults
120
- steps :
121
- - attach_workspace :
122
- at : ~/react-native-viewpager
123
- - restore-cache : *restore-gradle-cache
124
- - run :
125
- name : Accept Android licences
126
- command : |-
127
- yes | sdkmanager --licenses || exit 0
128
- yes | sdkmanager --update || exit 0
21
+ at : .
22
+ - rn/yarn_install
129
23
- run :
130
- name : Build Android Example App and Library
131
- command : |-
132
- cd example/android
133
- ./gradlew clean assembleDebug
134
- - save-cache : *save-gradle-cache
135
-
136
- ios-checkout :
137
- << : *macos_defaults
138
- steps :
139
- - checkout
140
- - restore-cache : *restore-yarn-cache
141
- - run : rm -rf node_modules
142
- - run : yarn cache clean
143
- - run : *yarn
144
- - save-cache : *save-yarn-cache
145
- - persist_to_workspace :
146
- root : .
147
- paths : .
148
-
149
- ios-compile :
150
- << : *macos_defaults
151
- steps :
152
- - attach_workspace :
153
- at : ~/react-native-viewpager
24
+ name : Run ESLint
25
+ command : yarn lint
154
26
- run :
155
- name : Build example app
156
- command : |-
157
- react-native run-ios --project-path example/ios
27
+ name : Flow
28
+ command : yarn flow
158
29
159
- # -------------------------
160
- # WORKFLOWS
161
- # -------------------------
162
30
workflows :
163
- version : 2
164
- Test :
31
+ test :
165
32
jobs :
166
- - linux-checkout
167
- - eslint :
168
- requires :
169
- - linux-checkout
170
- - flow :
33
+ # Checkout the code and persist to the Workspace
34
+ # Note: This is a job which is defined above and not part of the Orb
35
+ - checkout_code
36
+
37
+ # Analyze the Javascript using ESLint, Flow, and Jest
38
+ # Note: This is a job which is defined above and not part of the Orb
39
+ - analyse_js :
171
40
requires :
172
- - linux-checkout
173
- # - jest:
174
- # requires:
175
- # - linux-checkout
176
- - android-compile :
41
+ - checkout_code
42
+
43
+ # Build the Android app in debug mode
44
+ - rn/android_build :
45
+ name : build_android
46
+ project_path : " example/android"
47
+ build_type : debug
177
48
requires :
178
- - linux-checkout
179
- # Disabled until we have macOS containers enabled
180
- # - ios-checkout
181
- # - ios-compile:
182
- # requires:
183
- # - ios-checkout
49
+ - analyse_js
0 commit comments