1+ unit_tests : &unit_tests
2+ steps :
3+ - checkout
4+ - restore_cache :
5+ key : dependency-cache-{{ checksum "package-lock.json" }}
6+ - run :
7+ name : Install Latest NPM.
8+ # npm@3 is buggy
9+ command : if [[ $(npm -v | cut -c -1) > 3 ]] ; then npm i -g npm@latest; else echo "Skip npm updating"; fi
10+ - run :
11+ name : NPM Install.
12+ command : npm ci || npm i
13+ - run :
14+ name : Run Test.
15+ command : npm run ci:test
16+ canary_tests : &canary_tests
17+ steps :
18+ - checkout
19+ - restore_cache :
20+ key : dependency-cache-{{ checksum "package-lock.json" }}
21+ - run :
22+ name : Install Latest NPM.
23+ command : npm i -g npm@latest
24+ - run :
25+ name : NPM Install.
26+ command : npm ci
27+ - run :
28+ name : Install Webpack Canary.
29+ command : npm i --no-save webpack@next
30+ - run :
31+ name : Run Test.
32+ command : if [[ $(compver --name webpack --gte next --lt latest) < 1 ]] ; then printf "Next is older than Latest - Skipping Canary Suite"; else npm run ci:test || true; fi
33+
34+ version : 2
35+ jobs :
36+ dependency_cache :
37+ docker :
38+ - image : webpackcontrib/circleci-node-base:latest
39+ steps :
40+ - checkout
41+ - restore_cache :
42+ key : dependency-cache-{{ checksum "package-lock.json" }}
43+ - run :
44+ name : Install Latest NPM.
45+ command : npm i -g npm@latest
46+ - run :
47+ name : NPM Install.
48+ command : npm ci
49+ - save_cache :
50+ key : dependency-cache-{{ checksum "package-lock.json" }}
51+ paths :
52+ - ./node_modules
53+ analysis :
54+ docker :
55+ - image : webpackcontrib/circleci-node-base:latest
56+ steps :
57+ - checkout
58+ - restore_cache :
59+ key : dependency-cache-{{ checksum "package-lock.json" }}
60+ - run :
61+ name : Install Latest NPM.
62+ command : npm i -g npm@latest
63+ - run :
64+ name : NPM Install.
65+ command : npm ci
66+ - run :
67+ name : Run linting.
68+ command : npm run lint
69+ - run :
70+ name : Run NPM Audit.
71+ command : npm run security
72+ - run :
73+ name : Validate Commit Messages.
74+ command : npm run ci:lint:commits
75+ node6-latest :
76+ docker :
77+ - image : webpackcontrib/circleci-node6:latest
78+ << : *unit_tests
79+ node8-latest :
80+ docker :
81+ - image : webpackcontrib/circleci-node8:latest
82+ << : *unit_tests
83+ node10-latest :
84+ docker :
85+ - image : webpackcontrib/circleci-node10:latest
86+ steps :
87+ - checkout
88+ - restore_cache :
89+ key : dependency-cache-{{ checksum "package-lock.json" }}
90+ - run :
91+ name : Install Latest NPM.
92+ command : npm i -g npm@latest
93+ - run :
94+ name : NPM Install.
95+ command : npm ci
96+ - run :
97+ name : Run Test.
98+ command : npm run ci:coverage
99+ - run :
100+ name : Submit coverage data to codecov.
101+ command : bash <(curl -s https://codecov.io/bash)
102+ when : on_success
103+ node8-canary :
104+ docker :
105+ - image : webpackcontrib/circleci-node8:latest
106+ << : *canary_tests
107+
108+ workflows :
109+ version : 2
110+ test :
111+ jobs :
112+ - dependency_cache
113+ - analysis :
114+ requires :
115+ - dependency_cache
116+ filters :
117+ tags :
118+ only : /.*/
119+ - node6-latest :
120+ requires :
121+ - dependency_cache
122+ filters :
123+ tags :
124+ only : /.*/
125+ - node8-latest :
126+ requires :
127+ - analysis
128+ - node6-latest
129+ filters :
130+ tags :
131+ only : /.*/
132+ - node10-latest :
133+ requires :
134+ - analysis
135+ - node6-latest
136+ filters :
137+ tags :
138+ only : /.*/
139+ - node8-canary :
140+ requires :
141+ - analysis
142+ - node6-latest
143+ filters :
144+ tags :
145+ only : /.*/
0 commit comments