|
| 1 | +# ------------------------- |
| 2 | +# ALIASES |
| 3 | +# ------------------------- |
| 4 | + |
| 5 | +aliases: |
| 6 | + # CACHE |
| 7 | + - &restore-gradle-cache |
| 8 | + keys: |
| 9 | + - gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }} |
| 10 | + - &save-gradle-cache |
| 11 | + paths: |
| 12 | + - ~/.gradle |
| 13 | + key: gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }} |
| 14 | + |
| 15 | + # ANALYSE |
| 16 | + - &eslint |
| 17 | + name: ESLint Checks |
| 18 | + command: yarn lint |
| 19 | + |
| 20 | + - &type-check |
| 21 | + name: TypeScript Checks |
| 22 | + command: yarn tsc |
| 23 | + |
| 24 | + - &flow |
| 25 | + name: Flow TypeChecks |
| 26 | + command: yarn flow |
| 27 | + |
| 28 | + - &jest |
| 29 | + name: Jest Unit Tests |
| 30 | + command: yarn test |
| 31 | + |
| 32 | +# ------------------------- |
| 33 | +# JOBS |
| 34 | +# ------------------------- |
| 35 | +version: 2.1 |
| 36 | +orbs: |
| 37 | + rn: react-native-community/[email protected] |
| 38 | + |
| 39 | +jobs: |
| 40 | + # Set up a Linux environment for downstream jobs |
| 41 | + linux-checkout: |
| 42 | + executor: rn/linux_js |
| 43 | + steps: |
| 44 | + - attach_workspace: |
| 45 | + at: . |
| 46 | + - checkout |
| 47 | + - rn/yarn_install |
| 48 | + - persist_to_workspace: |
| 49 | + root: . |
| 50 | + paths: . |
| 51 | + |
| 52 | + eslint: |
| 53 | + executor: rn/linux_js |
| 54 | + steps: |
| 55 | + - attach_workspace: |
| 56 | + at: . |
| 57 | + - run: *eslint |
| 58 | + |
| 59 | + type-check: |
| 60 | + executor: rn/linux_js |
| 61 | + steps: |
| 62 | + - attach_workspace: |
| 63 | + at: . |
| 64 | + - run: *type-check |
| 65 | + |
| 66 | + flow: |
| 67 | + executor: rn/linux_js |
| 68 | + steps: |
| 69 | + - attach_workspace: |
| 70 | + at: . |
| 71 | + - run: *flow |
| 72 | + |
| 73 | + jest: |
| 74 | + executor: rn/linux_js |
| 75 | + steps: |
| 76 | + - attach_workspace: |
| 77 | + at: . |
| 78 | + - run: *jest |
| 79 | + |
| 80 | + android-compile: |
| 81 | + executor: rn/linux_android |
| 82 | + steps: |
| 83 | + - attach_workspace: |
| 84 | + at: . |
| 85 | + - restore_cache: *restore-gradle-cache |
| 86 | + - run: |
| 87 | + name: Accept Android licences |
| 88 | + command: |- |
| 89 | + yes | sdkmanager --licenses || exit 0 |
| 90 | + yes | sdkmanager --update || exit 0 |
| 91 | + - run: |
| 92 | + name: Build Android Example App and Library |
| 93 | + command: |- |
| 94 | + cd example/android |
| 95 | + ./gradlew clean assembleDebug |
| 96 | + - save_cache: *save-gradle-cache |
| 97 | + |
| 98 | + ios-checkout: |
| 99 | + executor: rn/macos |
| 100 | + steps: |
| 101 | + - checkout |
| 102 | + - rn/yarn_install |
| 103 | + - persist_to_workspace: |
| 104 | + root: . |
| 105 | + paths: . |
| 106 | + |
| 107 | + ios-compile: |
| 108 | + executor: rn/macos |
| 109 | + steps: |
| 110 | + - attach_workspace: |
| 111 | + at: . |
| 112 | + - run: |
| 113 | + name: Build example app |
| 114 | + command: |- |
| 115 | + react-native run-ios --project-path example/ios |
| 116 | +
|
| 117 | +# ------------------------- |
| 118 | +# WORKFLOWS |
| 119 | +# ------------------------- |
| 120 | +workflows: |
| 121 | + version: 2 |
| 122 | + Test: |
| 123 | + jobs: |
| 124 | + - linux-checkout |
| 125 | + - eslint: |
| 126 | + requires: |
| 127 | + - linux-checkout |
| 128 | + # TODO: implement typescript types |
| 129 | + # - type-check: |
| 130 | + # requires: |
| 131 | + # - linux-checkout |
| 132 | + # TODO: implement test |
| 133 | + # - jest: |
| 134 | + # requires: |
| 135 | + # - linux-checkout |
| 136 | + - flow: |
| 137 | + requires: |
| 138 | + - linux-checkout |
| 139 | + - android-compile: |
| 140 | + requires: |
| 141 | + - linux-checkout |
| 142 | +# Disabled until we have macOS containers enabled |
| 143 | +# - ios-checkout |
| 144 | +# - ios-compile: |
| 145 | +# requires: |
| 146 | +# - ios-checkout |
0 commit comments