Skip to content

Commit 6835c4b

Browse files
committed
💚 Add circle config file
1 parent 7d7fe9c commit 6835c4b

File tree

3 files changed

+87
-10
lines changed

3 files changed

+87
-10
lines changed

.circleci/config.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
version: 2
2+
3+
jobs:
4+
install:
5+
working_directory: ~/mongoose-cursor-pagination
6+
docker:
7+
- image: circleci/node:8.10.0
8+
steps:
9+
- checkout
10+
- restore_cache:
11+
keys:
12+
- v1-dependencies-{{ checksum "package.json" }}
13+
# fallback to using the latest cache if no exact match is found
14+
- v1-dependencies-
15+
- attach_workspace:
16+
at: ~/mongoose-cursor-pagination
17+
- run:
18+
name: NPM Install
19+
command: npm install
20+
- save_cache:
21+
paths:
22+
- node_modules
23+
key: v1-dependencies-{{ checksum "package.json" }}
24+
- persist_to_workspace:
25+
root: ~/mongoose-cursor-pagination
26+
paths: ./node_modules
27+
build:
28+
working_directory: ~/mongoose-cursor-pagination
29+
docker:
30+
- image: circleci/node:8.10.0
31+
steps:
32+
- checkout
33+
- attach_workspace:
34+
at: ~/mongoose-cursor-pagination
35+
- run:
36+
name: Build
37+
command: |
38+
if [ "${CIRCLE_BRANCH}" == "master" ]; then
39+
NODE_ENV=production \
40+
npm run prepare
41+
else
42+
NODE_ENV=development \
43+
npm run build
44+
fi
45+
- persist_to_workspace:
46+
root: ~/mongoose-cursor-pagination
47+
paths:
48+
- ./lib
49+
lint:
50+
working_directory: ~/mongoose-cursor-pagination
51+
docker:
52+
- image: circleci/node:8.10.0
53+
steps:
54+
- checkout
55+
- attach_workspace:
56+
at: ~/mongoose-cursor-pagination
57+
- run:
58+
name: Lint
59+
command: npm run lint:ci
60+
test:
61+
working_directory: ~/mongoose-cursor-pagination
62+
docker:
63+
- image: circleci/node:8.10.0
64+
steps:
65+
- checkout
66+
- attach_workspace:
67+
at: ~/mongoose-cursor-pagination
68+
- run:
69+
name: Tests
70+
command: npm run test
71+
72+
workflows:
73+
version: 2
74+
install_build_lint_test:
75+
jobs:
76+
- install
77+
- build:
78+
requires:
79+
- install
80+
- lint:
81+
requires:
82+
- install
83+
- test:
84+
requires:
85+
- install

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
],
99
"scripts": {
1010
"prepare": "babel src --out-dir lib",
11-
"test": "standard && babel src --out-dir lib && mocha 'lib/**/__tests__/*' --exit",
11+
"test": "mocha 'lib/**/__tests__/*' --exit",
1212
"format": "prettier --write 'src/**/*.js'",
13+
"lint:ci": "CI=true eslint . --ignore-path .gitignore --quiet",
1314
"lint": "eslint . --ignore-path .gitignore",
1415
"check-branch": "enkidevs-assert-restricted-branch"
1516
},

0 commit comments

Comments
 (0)