Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #230 from infinitered/circle-ci-cleanup
Browse files Browse the repository at this point in the history
Configure for Circle CI
  • Loading branch information
morgandonze authored Nov 28, 2018
2 parents ab84e8b + f996503 commit ecb93cd
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 2 deletions.
82 changes: 82 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#

defaults: &defaults
docker:
# Choose the version of Node you want here
- image: circleci/node:10.11
working_directory: ~/repo

version: 2
jobs:
setup:
<<: *defaults
steps:
- checkout
- restore_cache:
name: Restore node modules
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install dependencies
command: |
yarn install
- save_cache:
name: Save node modules
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}


tests:
<<: *defaults
steps:
- checkout
- restore_cache:
name: Restore node modules
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install React Native CLI and Ignite CLI
command: |
sudo npm i -g ignite-cli react-native-cli
- run:
name: Run tests
command: yarn ci:test # this command will be added to/found in your package.json scripts

publish:
<<: *defaults
steps:
- checkout
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- restore_cache:
name: Restore node modules
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
# Run semantic-release after all the above is set.
- run:
name: Publish to NPM
command: yarn ci:publish # this will be added to your package.json scripts

workflows:
version: 2
test_and_release:
jobs:
- setup
- tests:
requires:
- setup
- publish:
requires:
- tests
filters:
branches:
only: master
23 changes: 21 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"test": "jest",
"watch": "jest --runInBand --watch",
"coverage": "jest --runInBand --coverage",
"shipit": "np"
"ci:test": "yarn test",
"ci:publish": "yarn semantic-release",
"semantic-release": "semantic-release"
},
"standard": {
"parser": "babel-eslint",
Expand All @@ -41,14 +43,31 @@
"describe"
]
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": "package.json",
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
},
"devDependencies": {
"@semantic-release/git": "^7.0.5",
"babel-eslint": "^7.1.1",
"fs-jetpack": "^1.0.0",
"jest": "^20.0.4",
"np": "^2.15.0",
"sinon": "^2.3.1",
"standard": "^10.0.2",
"tempy": "^0.1.0"
"tempy": "^0.1.0",
"socks": "^2.1.6"
},
"dependencies": {
"ramda": "^0.23.0"
Expand Down

0 comments on commit ecb93cd

Please sign in to comment.