Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
FonDorn committed Mar 2, 2019
1 parent cfa15a1 commit 8eafde4
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 1 deletion.
97 changes: 97 additions & 0 deletions .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
15 changes: 14 additions & 1 deletion 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
Expand Down Expand Up @@ -77,4 +82,12 @@ The following image demonstrates that you can put almost anything behind the mas

| Type | Required |
| ------- | -------- |
| element | Yes |
| element | Yes |

<!-- badges -->
[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

0 comments on commit 8eafde4

Please sign in to comment.