From 8eafde42fa28ed0fd2e9601358db1dc535242a5f Mon Sep 17 00:00:00 2001 From: Mike Nedosekin Date: Sat, 2 Mar 2019 09:03:21 +0200 Subject: [PATCH] Add CI --- .circleci/config.yml | 97 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 15 ++++++- 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7b3caaa --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,97 @@ +# ------------------------- +# 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" }} + +# ------------------------- +# INSTALLATION +# ------------------------- +- &yarn + name: Yarn Install + command: | + yarn install --network-concurrency 1 --non-interactive --cache-folder ~/.cache/yarn & wait + +# ------------------------- +# ANALYSE +# ------------------------- + +- &flow + name: Flow Checks + command: yarn test:flow + +# ------------------------- +# DEFAULTS +# ------------------------- +defaults: &defaults + working_directory: ~/react-native-masked-view + environment: + - GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1 + +# JAVASCRIPT +js_defaults: &js_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" + +# ------------------------- +# JOBS +# ------------------------- +version: 2 +jobs: + # Set up a Node environment for downstream jobs + checkout-code: + <<: *js_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: . + + flow: + <<: *js_defaults + steps: + - attach_workspace: + at: ~/react-native-masked-view + - run: *flow + + javascript: + <<: *js_defaults + steps: + - attach_workspace: + at: ~/react-native-masked-view + - run: *javascript + + +# ------------------------- +# WORK FLOWS +# ------------------------- +workflows: + version: 2 + Test: + jobs: + - checkout-code + - flow: + requires: + - checkout-code + - javascript: + requires: + - checkout-code \ No newline at end of file diff --git a/README.md b/README.md index 4084e9a..412b25e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # React Native MaskedView + +[![Build Status][build-badge]][build] +[![Version][version-badge]][package] +[![MIT License][license-badge]][license] + React Native MaskedView for iOS. ## Platforms Supported @@ -77,4 +82,12 @@ The following image demonstrates that you can put almost anything behind the mas | Type | Required | | ------- | -------- | -| element | Yes | \ No newline at end of file +| element | Yes | + + +[build-badge]: https://img.shields.io/circleci/project/github/react-native-community/react-native-masked-view/master.svg?style=flat-square +[build]: https://circleci.com/gh/react-native-community/react-native-masked-view +[version-badge]: https://img.shields.io/npm/v/@react-native-community/masked-view.svg?style=flat-square +[package]: https://www.npmjs.com/package/@react-native-community/masked-view +[license-badge]: https://img.shields.io/npm/l/@react-native-community/masked-view.svg?style=flat-square +[license]: https://opensource.org/licenses/MIT