Skip to content

Commit 7cc7ae5

Browse files
Merge pull request #43 from n1ru4l/change-circle-ci-config
chore: update circle-ci config to build against multiple node versions
2 parents 6fb0b6a + 4e568da commit 7cc7ae5

File tree

2 files changed

+50
-40
lines changed

2 files changed

+50
-40
lines changed

circle.yml

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
1+
workflows:
2+
version: 2
3+
node-multi-build:
4+
jobs:
5+
- node-v6
6+
- node-v8
7+
- node-v10
8+
19
version: 2
210
jobs:
3-
build:
4-
working_directory: ~/apollo-resolvers
5-
parallelism: 1
6-
shell: /bin/bash --login
7-
environment:
8-
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
9-
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
11+
node-base: &node-base
1012
docker:
11-
- image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
12-
command: /sbin/init
13+
- image: node
1314
steps:
14-
- checkout
15-
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
16-
- run:
17-
working_directory: ~/apollo-resolvers
18-
command: nvm install 5.5.0 && nvm alias default 5.5.0
19-
# Dependencies
20-
# Restore the dependency cache
21-
- restore_cache:
22-
keys:
23-
- v1-dep-{{ .Branch }}-
24-
- v1-dep-master-
25-
- v1-dep-
26-
- run: make configure
27-
# Save dependency cache
28-
- save_cache:
29-
key: v1-dep-{{ .Branch }}-{{ epoch }}
30-
paths:
31-
- ./node_modules
32-
- run: make lint
33-
- run: make
34-
- run: make test
35-
# Teardown
36-
# Save test results
37-
- store_test_results:
38-
path: /tmp/circleci-test-results
39-
# Save artifacts
40-
- store_artifacts:
41-
path: /tmp/circleci-artifacts
42-
- store_artifacts:
43-
path: /tmp/circleci-test-results
15+
- checkout
16+
- restore_cache:
17+
keys:
18+
- npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
19+
- npm-lock-master-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
20+
- npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
21+
- npm-cache-master-{{ .Environment.CIRCLE_JOB }}
22+
- run:
23+
name: Install dependencies
24+
command: npm install
25+
- run:
26+
name: Build
27+
command: npm run build
28+
- run:
29+
name: Test
30+
command: npm run test
31+
- save_cache:
32+
key: npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
33+
paths:
34+
- node_modules
35+
- save_cache:
36+
key: npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
37+
paths:
38+
- ~/.npm/_cacache
39+
node-v6:
40+
<<: *node-base
41+
docker:
42+
- image: node:6
43+
node-v8:
44+
<<: *node-base
45+
docker:
46+
- image: node:8
47+
node-v10:
48+
<<: *node-base
49+
docker:
50+
- image: node:10

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
8-
"test": "make test"
8+
"test": "mocha",
9+
"build": "tsc",
10+
"lint": "eslint src test",
11+
"clean": "rimraf test"
912
},
1013
"repository": {
1114
"type": "git",

0 commit comments

Comments
 (0)