1 | restore_cache: &restore_cache
|
2 | keys:
|
3 | - node-modules-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ checksum "package.json" }}
|
4 | - node-modules-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
|
5 | - node-modules-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
|
6 |
|
7 | save_cache: &save_cache
|
8 | key: node-modules-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ checksum "package.json" }}
|
9 | paths:
|
10 | - node_modules
|
11 |
|
12 | steps: &steps
|
13 | - checkout
|
14 | - restore_cache: *restore_cache
|
15 | - run: "echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ./.npmrc"
|
16 | - run: npm install
|
17 | - run: npm test
|
18 | - save_cache: *save_cache
|
19 | - store_test_results:
|
20 | path: reports
|
21 |
|
22 | version: 2
|
23 | jobs:
|
24 | lint:
|
25 | docker:
|
26 | - image: node:8
|
27 | steps:
|
28 | - checkout
|
29 | - restore_cache: *restore_cache
|
30 | - run: "echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ./.npmrc"
|
31 | - run: npm install
|
32 | - run: npm run lint
|
33 | - save_cache: *save_cache
|
34 |
|
35 | test-node-8:
|
36 | docker:
|
37 | - image: node:8
|
38 | steps: *steps
|
39 |
|
40 | release:
|
41 | docker:
|
42 | - image: node:8
|
43 | steps:
|
44 | - checkout
|
45 | - restore_cache: *restore_cache
|
46 | - run: "echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ./.npmrc"
|
47 | - run: npm install
|
48 | - deploy:
|
49 | command: |
|
50 | npm run semantic-release
|
51 | - save_cache: *save_cache
|
52 |
|
53 | workflows:
|
54 | version: 2
|
55 | build:
|
56 | jobs:
|
57 | - test-node-8:
|
58 |
|
59 |
|
60 | context: read-only
|
61 |
|
62 |
|
63 | - lint:
|
64 |
|
65 |
|
66 | context: read-only
|
67 | - release:
|
68 | context: org-global
|
69 | filters:
|
70 | branches:
|
71 | only: master
|
72 | requires:
|
73 | - test-node-8
|
74 | - lint
|