Skip to content

Commit a97a788

Browse files
committed
[CIRCLE_CI]: added new config.yml
1 parent d2c1a3e commit a97a788

File tree

2 files changed

+100
-48
lines changed

2 files changed

+100
-48
lines changed

.circleci/config.yml

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,53 @@
1-
---
21
version: 2
32
jobs:
4-
node-latest: &test
3+
build:
4+
working_directory: ~/mern-starter
5+
# The primary container is an instance of the first image listed. The job's commands run in this container.
56
docker:
6-
- image: node:latest
7-
working_directory: ~/cli
7+
- image: circleci/node:4.8.2-jessie
8+
# The secondary container is an instance of the second listed image which is run in a common network where ports exposed on the primary container are available on localhost.
9+
- image: mongo:3.4.4-jessie
810
steps:
911
- checkout
10-
- restore_cache: &restore_cache
11-
keys:
12-
- v1-npm-{{checksum ".circleci/config.yml"}}-{{ checksum "package-lock.json"}}
13-
- v1-npm-{{checksum ".circleci/config.yml"}}
1412
- run:
15-
name: Install dependencies
16-
command: .circleci/greenkeeper
17-
- run: ./bin/run --version
18-
- run: ./bin/run --help
13+
name: Update npm
14+
command: 'sudo npm install -g npm@latest'
15+
- restore_cache:
16+
key: dependency-cache-{{ checksum "package-lock.json" }}
1917
- run:
20-
name: Testing
21-
command: npm test
22-
- run:
23-
name: Submitting code coverage to codecov
24-
command: |
25-
./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov
26-
curl -s https://codecov.io/bash | bash
27-
node-8:
28-
<<: *test
18+
name: Install npm wee
19+
command: npm install
20+
- save_cache:
21+
key: dependency-cache-{{ checksum "package-lock.json" }}
22+
paths:
23+
- node_modules
24+
test:
2925
docker:
30-
- image: node:8
31-
release:
32-
<<: *test
26+
- image: circleci/node:4.8.2-jessie
27+
- image: mongo:3.4.4-jessie
3328
steps:
34-
- add_ssh_keys
3529
- checkout
36-
- restore_cache: *restore_cache
3730
- run:
38-
name: Install dependencies
39-
command: |
40-
npm install -g @oclif/semantic-release@3 semantic-release@15
41-
npm install
31+
name: Test
32+
command: npm test
4233
- run:
43-
name: Cutting release
44-
command: |
45-
semantic-release -e @oclif/semantic-release
46-
- save_cache:
47-
key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "package-lock.json"}}
48-
paths:
49-
- ~/cli/node_modules
50-
- ~/.npm
51-
- /usr/local/lib/node_modules
34+
name: Generate code coverage
35+
command: './node_modules/.bin/nyc report --reporter=text-lcov'
36+
- store_artifacts:
37+
path: test-results.xml
38+
prefix: tests
39+
- store_artifacts:
40+
path: coverage
41+
prefix: coverage
5242

5343
workflows:
5444
version: 2
55-
"cdt":
45+
build_and_test:
5646
jobs:
57-
- node-latest
58-
- node-8
59-
- release:
60-
context: org-global
61-
filters:
62-
branches: {only: master}
47+
- build
48+
- test:
6349
requires:
64-
- node-latest
65-
- node-8
50+
- build
51+
filters:
52+
branches:
53+
only: master

.circleci/config_tmp.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
version: 2
2+
jobs:
3+
node-latest: &test
4+
docker:
5+
- image: node:latest
6+
working_directory: ~/cli
7+
steps:
8+
- checkout
9+
- restore_cache: &restore_cache
10+
keys:
11+
- v1-npm-{{checksum ".circleci/config_tmp.yml"}}-{{ checksum "package-lock.json"}}
12+
- v1-npm-{{checksum ".circleci/config_tmp.yml"}}
13+
- run:
14+
name: Install dependencies
15+
command: .circleci/greenkeeper
16+
- run: ./bin/run --version
17+
- run: ./bin/run --help
18+
- run:
19+
name: Testing
20+
command: npm test
21+
- run:
22+
name: Submitting code coverage to codecov
23+
command: |
24+
./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov
25+
curl -s https://codecov.io/bash | bash
26+
node-8:
27+
<<: *test
28+
docker:
29+
- image: node:8
30+
release:
31+
<<: *test
32+
steps:
33+
- add_ssh_keys
34+
- checkout
35+
- restore_cache: *restore_cache
36+
- run:
37+
name: Install dependencies
38+
command: |
39+
npm install -g @oclif/semantic-release@3 semantic-release@15
40+
npm install
41+
- run:
42+
name: Cutting release
43+
command: |
44+
semantic-release -e @oclif/semantic-release
45+
- save_cache:
46+
key: v1-npm-{{checksum ".circleci/config_tmp.yml"}}-{{checksum "package-lock.json"}}
47+
paths:
48+
- ~/cli/node_modules
49+
- ~/.npm
50+
- /usr/local/lib/node_modules
51+
52+
workflows:
53+
version: 2
54+
"cdt":
55+
jobs:
56+
- node-latest
57+
- node-8
58+
- release:
59+
context: org-global
60+
filters:
61+
branches: {only: master}
62+
requires:
63+
- node-latest
64+
- node-8

0 commit comments

Comments
 (0)