Skip to content

Commit 2642e20

Browse files
authored
Merge pull request #35 from Testlio/feature/circleci2.0
circleci 2.0
2 parents c74300a + 58f96c0 commit 2642e20

File tree

2 files changed

+101
-13
lines changed

2 files changed

+101
-13
lines changed

.circleci/config.yml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
version: 2
2+
workflows:
3+
version: 2
4+
install-test-publish:
5+
jobs:
6+
- install-dependencies:
7+
filters:
8+
tags:
9+
only: /.*/
10+
- test:
11+
filters:
12+
tags:
13+
only: /.*/
14+
requires:
15+
- install-dependencies
16+
- lint:
17+
filters:
18+
tags:
19+
only: /.*/
20+
requires:
21+
- install-dependencies
22+
- approve-publish-npm:
23+
type: approval
24+
filters:
25+
tags:
26+
only: /v[0-9]+(\.[0-9]+)*/
27+
branches:
28+
ignore: /.*/
29+
requires:
30+
- test
31+
- lint
32+
- publish-npm:
33+
filters:
34+
tags:
35+
only: /v[0-9]+(\.[0-9]+)*/
36+
branches:
37+
ignore: /.*/
38+
requires:
39+
- approve-publish-npm
40+
41+
defaults:
42+
docker: &default
43+
working_directory: ~/builds
44+
docker:
45+
- image: circleci/node:6
46+
47+
jobs:
48+
install-dependencies:
49+
<<: *default
50+
steps:
51+
- checkout
52+
- restore_cache:
53+
keys:
54+
- dependencies-cache-{{ checksum "package.json" }}
55+
- dependencies-cache-
56+
- run:
57+
name: Install dependencies
58+
command: npm install --no-save
59+
- save_cache:
60+
key: dependency-cache-{{ checksum "package.json" }}
61+
paths:
62+
- node_modules
63+
- persist_to_workspace:
64+
root: .
65+
paths: node_modules
66+
67+
test:
68+
<<: *default
69+
steps:
70+
- checkout
71+
- attach_workspace:
72+
at: ~/builds
73+
- run:
74+
name: Run tests
75+
command:
76+
npm test
77+
78+
lint:
79+
<<: *default
80+
steps:
81+
- checkout
82+
- attach_workspace:
83+
at: ~/builds
84+
- run:
85+
name: Run linter
86+
command:
87+
npm run lint
88+
89+
publish-npm:
90+
<<: *default
91+
steps:
92+
- checkout
93+
- attach_workspace:
94+
at: ~/builds
95+
- run:
96+
name: Authenticate with registry
97+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/builds/.npmrc
98+
- run:
99+
name: Publish package
100+
command:
101+
npm publish

circle.yml

-13
This file was deleted.

0 commit comments

Comments
 (0)