1 | version: 2.1
|
2 | jobs:
|
3 | node:
|
4 | working_directory: ~/react-native-firebaseui-auth
|
5 | docker:
|
6 | - image: circleci/node:lts
|
7 | steps:
|
8 | - checkout
|
9 |
|
10 | - restore_cache:
|
11 | key: yarn-v1-{{ checksum "example/yarn.lock" }}-{{ arch }}
|
12 |
|
13 | - restore_cache:
|
14 | key: node-v1-{{ checksum "example/package.json" }}-{{ arch }}
|
15 |
|
16 | - run:
|
17 | name: install dependences
|
18 | command: |
|
19 | cd example
|
20 | yarn install
|
21 |
|
22 | - save_cache:
|
23 | key: yarn-v1-{{ checksum "example/yarn.lock" }}-{{ arch }}
|
24 | paths:
|
25 | - ~/.cache/yarn
|
26 |
|
27 | - save_cache:
|
28 | key: node-v1-{{ checksum "example/package.json" }}-{{ arch }}
|
29 | paths:
|
30 | - example/node_modules
|
31 |
|
32 | - run:
|
33 | name: run tests
|
34 | command: |
|
35 | mkdir -p test-results/jest
|
36 | cd example
|
37 | yarn test
|
38 | environment:
|
39 | JEST_JUNIT_OUTPUT: ./test-results/jest/junit.xml
|
40 |
|
41 | - store_test_results:
|
42 | path: ./example/test-results
|
43 |
|
44 | - persist_to_workspace:
|
45 | root: ~/react-native-firebaseui-auth
|
46 | paths:
|
47 | - example/node_modules
|
48 |
|
49 | android:
|
50 | working_directory: ~/react-native-firebaseui-auth/example/android
|
51 | docker:
|
52 | - image: circleci/android:api-28-node8-alpha
|
53 | steps:
|
54 | - checkout:
|
55 | path: ~/react-native-firebaseui-auth
|
56 |
|
57 | - attach_workspace:
|
58 | at: ~/react-native-firebaseui-auth
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 | - restore_cache:
|
78 | key: jars-cache-{{ .Branch }}-{{ checksum "./build.gradle" }}-{{ checksum "./app/build.gradle" }}
|
79 |
|
80 | - run:
|
81 | name: make gradlew executable
|
82 | command: |
|
83 | echo 'export TERM=xterm' >> $BASH_ENV && sudo chmod +x gradlew
|
84 |
|
85 | - run:
|
86 | name: accept all licenses on error
|
87 | command: |
|
88 | yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses || if [ $? -ne '141' ]; then exit $?; fi; #Captures SIGPIPE 141 error but still allow repeating "y" to accept all licenses
|
89 |
|
90 | - run:
|
91 | name: build debug
|
92 | command: |
|
93 | cd app
|
94 | mv ./gs ./google-services.json
|
95 | cd ../..
|
96 | npx jetify
|
97 | cd android
|
98 | ./gradlew assembleDebug
|
99 |
|
100 | - store_artifacts:
|
101 | path: ./app/build/outputs/apk/debug/app-debug.apk
|
102 | destination: app-debug.apk
|
103 |
|
104 | ios:
|
105 | macos:
|
106 | xcode: "9.0"
|
107 | working_directory: ~/react-native-firebaseui-auth/example/ios
|
108 |
|
109 |
|
110 | shell: /bin/bash --login -o pipefail
|
111 |
|
112 | steps:
|
113 | - checkout
|
114 |
|
115 | - run:
|
116 | name: set Ruby version
|
117 | command: echo "ruby-2.4" > ~/.ruby-version
|
118 |
|
119 | - restore_cache:
|
120 | key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
|
121 |
|
122 | - restore_cache:
|
123 | key: node-v1-{{ checksum "package.json" }}-{{ arch }}
|
124 |
|
125 |
|
126 |
|
127 | - run: yarn install
|
128 |
|
129 | - save_cache:
|
130 | key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
|
131 | paths:
|
132 | - ~/.cache/yarn
|
133 |
|
134 | - save_cache:
|
135 | key: node-v1-{{ checksum "package.json" }}-{{ arch }}
|
136 | paths:
|
137 | - node_modules
|
138 |
|
139 | - restore_cache:
|
140 | key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }}
|
141 |
|
142 | - run:
|
143 | command: bundle install
|
144 | working_directory: ios
|
145 |
|
146 | - save_cache:
|
147 | key: bundle-v1-{{ checksum "ios/Gemfile.lock" }}-{{ arch }}
|
148 | paths:
|
149 | - vendor/bundle
|
150 |
|
151 | - run:
|
152 | command: bundle exec fastlane test
|
153 | working_directory: ios
|
154 |
|
155 | - run:
|
156 | name: set up test results
|
157 | working_directory: ios
|
158 | when: always
|
159 | command: |
|
160 | mkdir -p test-results/fastlane test-results/xcode
|
161 | mv fastlane/report.xml test-results/fastlane
|
162 | mv fastlane/test_output/report.junit test-results/xcode/junit.xml
|
163 |
|
164 | - store_test_results:
|
165 | path: ios/test-results
|
166 |
|
167 | - store_artifacts:
|
168 | path: ios/test-results
|
169 |
|
170 | workflows:
|
171 | version: 2
|
172 | node-android-ios:
|
173 | jobs:
|
174 | - node
|
175 | - android:
|
176 | requires:
|
177 | - node
|
178 |
|
179 |
|
180 |
|