Skip to content

Commit 07244f8

Browse files
committed
chore: use community circleci orb
1 parent 74c1cbd commit 07244f8

File tree

1 file changed

+21
-76
lines changed

1 file changed

+21
-76
lines changed

.circleci/config.yml

Lines changed: 21 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,9 @@
1-
# -------------------------
2-
# DEFAULTS
3-
# -------------------------
4-
defaults: &defaults
5-
working_directory: ~/react-native-progress-bar-android
6-
environment:
7-
- GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1
8-
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"
16-
17-
# ANDROID
18-
android_defaults: &android_defaults
19-
<<: *defaults
20-
docker:
21-
- image: circleci/android:api-27-node8-alpha
22-
resource_class: "medium"
23-
environment:
24-
- TERM: "dumb"
25-
- ADB_INSTALL_TIMEOUT: 10
26-
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
27-
- GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
28-
- BUILD_THREADS: 2
29-
30-
# MACOS
31-
macos_defaults: &macos_defaults
32-
<<: *defaults
33-
resource_class: "medium"
34-
macos:
35-
xcode: "10.1.0"
36-
371
# -------------------------
382
# ALIASES
393
# -------------------------
404

415
aliases:
426
# CACHE
43-
- &restore-yarn-cache
44-
keys:
45-
- yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
46-
- yarn-cache-{{ arch }}
47-
- &save-yarn-cache
48-
paths:
49-
- ~/.cache/yarn
50-
- ~/Library/Detox/ios
51-
key: yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
52-
537
- &restore-gradle-cache
548
keys:
559
- gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }}
@@ -58,12 +12,6 @@ aliases:
5812
- ~/.gradle
5913
key: gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }}
6014

61-
# INSTALLATION
62-
- &yarn
63-
name: Yarn Install
64-
command: |
65-
yarn install --network-concurrency 1 --non-interactive --cache-folder ~/.cache/yarn & wait
66-
6715
# ANALYSE
6816
- &eslint
6917
name: ESLint Checks
@@ -80,49 +28,50 @@ aliases:
8028
# -------------------------
8129
# JOBS
8230
# -------------------------
83-
version: 2
31+
version: 2.1
32+
orbs:
33+
rn: react-native-community/[email protected]
34+
8435
jobs:
8536
# Set up a Linux environment for downstream jobs
8637
linux-checkout:
87-
<<: *linux_defaults
38+
executor: rn/linux_js
8839
steps:
40+
- attach_workspace:
41+
at: .
8942
- checkout
90-
- restore-cache: *restore-yarn-cache
91-
- run: rm -rf node_modules
92-
- run: yarn cache clean
93-
- run: *yarn
94-
- save-cache: *save-yarn-cache
43+
- rn/yarn_install
9544
- persist_to_workspace:
9645
root: .
9746
paths: .
9847

9948
eslint:
100-
<<: *linux_defaults
49+
executor: rn/linux_js
10150
steps:
10251
- attach_workspace:
103-
at: ~/react-native-progress-bar-android
52+
at: .
10453
- run: *eslint
10554

10655
# type-check:
10756
# <<: *linux_defaults
10857
# steps:
10958
# - attach_workspace:
110-
# at: ~/react-native-progress-bar-android
59+
# at: .
11160
# - run: *type-check
11261

11362
jest:
114-
<<: *linux_defaults
63+
executor: rn/linux_js
11564
steps:
11665
- attach_workspace:
117-
at: ~/react-native-progress-bar-android
66+
at: .
11867
- run: *jest
11968

12069
android-compile:
121-
<<: *android_defaults
70+
executor: rn/linux_android
12271
steps:
12372
- attach_workspace:
124-
at: ~/react-native-progress-bar-android
125-
- restore-cache: *restore-gradle-cache
73+
at: .
74+
- restore_cache: *restore-gradle-cache
12675
- run:
12776
name: Accept Android licences
12877
command: |-
@@ -135,26 +84,22 @@ jobs:
13584
yarn install
13685
cd android
13786
./gradlew clean assembleDebug
138-
- save-cache: *save-gradle-cache
87+
- save_cache: *save-gradle-cache
13988

14089
ios-checkout:
141-
<<: *macos_defaults
90+
executor: rn/macos
14291
steps:
14392
- checkout
144-
- restore-cache: *restore-yarn-cache
145-
- run: rm -rf node_modules
146-
- run: yarn cache clean
147-
- run: *yarn
148-
- save-cache: *save-yarn-cache
93+
- rn/yarn_install
14994
- persist_to_workspace:
15095
root: .
15196
paths: .
15297

15398
ios-compile:
154-
<<: *macos_defaults
99+
executor: rn/macos
155100
steps:
156101
- attach_workspace:
157-
at: ~/react-native-progress-bar-android
102+
at: .
158103
- run:
159104
name: Build example app
160105
command: |-

0 commit comments

Comments
 (0)