Skip to content

Commit 6a47687

Browse files
committed
add circleCI integration
1 parent cdd1bad commit 6a47687

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.circleci/config.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: 2.0
2+
3+
# Inspired by:
4+
# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml
5+
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
6+
#
7+
# For list of official CircleCI node.js images, go to:
8+
# https://hub.docker.com/r/circleci/node/tags/
9+
10+
jobs:
11+
build:
12+
docker:
13+
- image: circleci/node:10.9.0
14+
working_directory: ~/react-plotly.js
15+
steps:
16+
- checkout
17+
- restore_cache:
18+
keys:
19+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
20+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ checksum "package-lock.json" }}
21+
- run:
22+
name: Install dependencies
23+
command: |
24+
npm install
25+
- run:
26+
name: List dependency versions
27+
command: |
28+
echo "npm: $(npm --version)"
29+
echo "node: $(node --version)"
30+
npm ls || true
31+
- save_cache:
32+
paths:
33+
- node_modules
34+
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }}
35+
- persist_to_workspace:
36+
root: .
37+
paths:
38+
- node_modules
39+
40+
test:
41+
docker:
42+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
43+
- image: circleci/node:10.9.0
44+
working_directory: ~/react-plotly.js
45+
steps:
46+
- checkout
47+
- attach_workspace:
48+
at: ~/react-plotly.js
49+
- run:
50+
name: Run tests
51+
command: npm run test
52+
53+
workflows:
54+
version: 2
55+
build-and-test:
56+
jobs:
57+
- build
58+
- test:
59+
requires:
60+
- build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ npm-debug.log*
44
*.sublime*
55

66
.*
7+
!.circleci
78
!.gitignore
89
!.gitattributes
910
!.npmignore

0 commit comments

Comments
 (0)