-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
# ------------------------- | ||
# DEFAULTS | ||
# ------------------------- | ||
defaults: &defaults | ||
working_directory: ~/react-native-viewpager | ||
environment: | ||
- GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1 | ||
|
||
# LINUX | ||
linux_defaults: &linux_defaults | ||
<<: *defaults | ||
docker: | ||
- image: circleci/node:8 | ||
environment: | ||
- PATH: "/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
|
||
# ANDROID | ||
android_defaults: &android_defaults | ||
<<: *defaults | ||
docker: | ||
- image: circleci/android:api-27-node8-alpha | ||
resource_class: "large" | ||
environment: | ||
- TERM: "dumb" | ||
- ADB_INSTALL_TIMEOUT: 10 | ||
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap" | ||
- GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"' | ||
- BUILD_THREADS: 2 | ||
|
||
# MACOS | ||
macos_defaults: &macos_defaults | ||
<<: *defaults | ||
resource_class: "large" | ||
macos: | ||
xcode: "10.1.0" | ||
|
||
# ------------------------- | ||
# ALIASES | ||
# ------------------------- | ||
|
||
aliases: | ||
# CACHE | ||
- &restore-yarn-cache | ||
keys: | ||
- yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} | ||
- yarn-cache-{{ arch }} | ||
- &save-yarn-cache | ||
paths: | ||
- ~/.cache/yarn | ||
- ~/Library/Detox/ios | ||
key: yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} | ||
|
||
- &restore-gradle-cache | ||
keys: | ||
- gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }} | ||
- &save-gradle-cache | ||
paths: | ||
- ~/.gradle | ||
key: gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }} | ||
|
||
# INSTALLATION | ||
- &yarn | ||
name: Yarn Install | ||
command: | | ||
yarn install --network-concurrency 1 --non-interactive --cache-folder ~/.cache/yarn & wait | ||
# ANALYSE | ||
# - &eslint | ||
# name: ESLint Checks | ||
# command: yarn test:eslint | ||
|
||
- &flow | ||
name: Flow Checks | ||
command: yarn flow check | ||
|
||
# - &jest | ||
# name: Jest Unit Tests | ||
# command: yarn test:jest | ||
|
||
# ------------------------- | ||
# JOBS | ||
# ------------------------- | ||
version: 2 | ||
jobs: | ||
# Set up a Linux environment for downstream jobs | ||
linux-checkout: | ||
<<: *linux_defaults | ||
steps: | ||
- checkout | ||
- restore-cache: *restore-yarn-cache | ||
- run: rm -rf node_modules | ||
- run: yarn cache clean | ||
- run: *yarn | ||
- save-cache: *save-yarn-cache | ||
- persist_to_workspace: | ||
root: . | ||
paths: . | ||
|
||
# eslint: | ||
# <<: *linux_defaults | ||
# steps: | ||
# - attach_workspace: | ||
# at: ~/react-native-viewpager | ||
# - run: *eslint | ||
|
||
flow: | ||
<<: *linux_defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/react-native-viewpager | ||
- run: *flow | ||
|
||
# jest: | ||
# <<: *linux_defaults | ||
# steps: | ||
# - attach_workspace: | ||
# at: ~/react-native-viewpager | ||
# - run: *jest | ||
|
||
android-compile: | ||
<<: *android_defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/react-native-viewpager | ||
- restore-cache: *restore-gradle-cache | ||
- run: | ||
name: Accept Android licences | ||
command: |- | ||
yes | sdkmanager --licenses || exit 0 | ||
yes | sdkmanager --update || exit 0 | ||
- run: | ||
name: Build Android Example App and Library | ||
command: |- | ||
cd example/android | ||
./gradlew clean assembleDebug | ||
- save-cache: *save-gradle-cache | ||
|
||
ios-checkout: | ||
<<: *macos_defaults | ||
steps: | ||
- checkout | ||
- restore-cache: *restore-yarn-cache | ||
- run: rm -rf node_modules | ||
- run: yarn cache clean | ||
- run: *yarn | ||
- save-cache: *save-yarn-cache | ||
- persist_to_workspace: | ||
root: . | ||
paths: . | ||
|
||
ios-compile: | ||
<<: *macos_defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/react-native-viewpager | ||
- run: | ||
name: Build example app | ||
command: |- | ||
react-native run-ios --project-path example/ios | ||
# ------------------------- | ||
# WORKFLOWS | ||
# ------------------------- | ||
workflows: | ||
version: 2 | ||
Test: | ||
jobs: | ||
- linux-checkout | ||
# - eslint: | ||
# requires: | ||
# - linux-checkout | ||
- flow: | ||
requires: | ||
- linux-checkout | ||
# - jest: | ||
# requires: | ||
# - linux-checkout | ||
- android-compile: | ||
requires: | ||
- linux-checkout | ||
# Disabled until we have macOS containers enabled | ||
# - ios-checkout | ||
# - ios-compile: | ||
# requires: | ||
# - ios-checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters