Skip to content

Commit e349322

Browse files
committed
Build multiple node versions on CircleCI
1 parent 65a0ad3 commit e349322

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

.circleci/config.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
1-
# Javascript Node CircleCI 2.0 configuration file
2-
#
3-
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4-
#
51
version: 2
6-
jobs:
7-
build:
8-
docker:
9-
# specify the version you desire here
10-
- image: circleci/node:7.10
11-
12-
# Specify service dependencies here if necessary
13-
# CircleCI maintains a library of pre-built images
14-
# documented at https://circleci.com/docs/2.0/circleci-images/
15-
# - image: circleci/mongo:3.4.4
162

3+
jobs:
4+
build-node-common: &build-node-common
175
steps:
186
- checkout
197

20-
# Download and cache dependencies
218
- restore_cache:
229
keys:
2310
- dependencies-{{ checksum "package-lock.json" }}
2411
# fallback to using the latest cache if no exact match is found
2512
- dependencies-
2613

27-
- run: npm i
14+
- run:
15+
name: Install dependencies
16+
command: npm i
2817

2918
- save_cache:
19+
key: dependencies-{{ checksum "package-lock.json" }}
3020
paths:
3121
- node_modules
32-
key: dependencies-{{ checksum "package-lock.json" }}
3322

34-
# run tests!
35-
- run: npm run test
23+
- run:
24+
name: Test
25+
command: npm test
26+
27+
build-node-6:
28+
<<: *build-node-common
29+
docker:
30+
- image: node:6
31+
32+
build-node-7:
33+
<<: *build-node-common
34+
docker:
35+
- image: node:7
36+
37+
build-node-8:
38+
<<: *build-node-common
39+
docker:
40+
- image: node:8
41+
42+
workflows:
43+
version: 2
44+
build_node_versions:
45+
jobs:
46+
- build-node-6
47+
- build-node-7
48+
- build-node-8

0 commit comments

Comments
 (0)