File tree 3 files changed +67
-33
lines changed
3 files changed +67
-33
lines changed Original file line number Diff line number Diff line change 1
- # Javascript Node CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4
- #
5
1
version : 2
6
- jobs :
7
- build :
2
+
3
+ docker_defaults : &docker_defaults
8
4
docker :
9
- - image : circleci/node:8.4
5
+ - image : circleci/node:8.11.1-browsers
6
+ working_directory : ~/project/repo
10
7
11
- working_directory : ~/repo
8
+ attach_workspace : &attach_workspace
9
+ attach_workspace :
10
+ at : ~/project
12
11
12
+ install_steps : &install_steps
13
13
steps :
14
- - checkout
15
-
16
- # Download and cache dependencies
17
- - restore_cache :
18
- keys :
19
- - v1-dependencies-{{ checksum "package.json" }}
20
- # fallback to using the latest cache if no exact match is found
21
- - v1-dependencies-
14
+ - checkout
15
+ - restore_cache :
16
+ name : Restore node_modules cache
17
+ keys :
18
+ - dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
19
+ - dependency-cache-{{ .Branch }}-
20
+ - dependency-cache-
21
+ - run :
22
+ name : Installing Dependencies
23
+ command : |
24
+ yarn install --silent
25
+ - save_cache :
26
+ name : Save node_modules cache
27
+ key : dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
28
+ paths :
29
+ - node_modules/
30
+ - persist_to_workspace :
31
+ root : ~/project
32
+ paths :
33
+ - repo
22
34
23
- - run : yarn install
24
-
25
- - save_cache :
26
- paths :
27
- - node_modules
28
- key : v1-dependencies-{{ checksum "package.json" }}
29
-
30
- # Start the examples server so that Cypress can run against them
31
- - run : yarn start
32
- # Install vxfb for Cypress
33
- - run : yarn add xvfb
34
- # Run eslint
35
- - run : yarn lint
36
- # Run tests
37
- - run : yarn test
35
+ workflows :
36
+ version : 2
37
+ build_pipeline :
38
+ jobs :
39
+ - build
40
+ - unit_test :
41
+ requires :
42
+ - build
43
+ - end_to_end :
44
+ requires :
45
+ - build
46
+ jobs :
47
+ build :
48
+ << : *docker_defaults
49
+ << : *install_steps
50
+ unit_test :
51
+ << : *docker_defaults
52
+ steps :
53
+ - *attach_workspace
54
+ - run :
55
+ name : Running unit tests
56
+ command : |
57
+ yarn lint
58
+ yarn test:jest
59
+ yarn coveralls
60
+ end_to_end :
61
+ << : *docker_defaults
62
+ steps :
63
+ - *attach_workspace
64
+ - run :
65
+ name : Running E2E tests
66
+ command : |
67
+ yarn e2e
Original file line number Diff line number Diff line change @@ -12,3 +12,6 @@ indent_size = 2
12
12
13
13
[* .md ]
14
14
trim_trailing_whitespace = false
15
+
16
+ [.circleci/config.yml ]
17
+ indent_size = 4
Original file line number Diff line number Diff line change 40
40
"chroma-js" : " ^1.3.6" ,
41
41
"chrono-node" : " ^1.3.5" ,
42
42
"codesandboxer" : " ^0.1.1" ,
43
+ "concurrently" : " ^3.5.1" ,
43
44
"copy-webpack-plugin" : " ^4.3.1" ,
44
45
"coveralls" : " ^2.11.12" ,
45
46
"cross-env" : " ^5.1.3" ,
93
94
"scripts" : {
94
95
"build" : " nps build && bundlesize" ,
95
96
"watch" : " nps build.watch" ,
96
- "cover" : " cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha" ,
97
- "coveralls" : " cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha && cat coverage/lcov.info | coveralls" ,
97
+ "coveralls" : " cat coverage/lcov.info | coveralls" ,
98
98
"lint" : " eslint ." ,
99
99
"deploy" : " cross-env NODE_ENV=production nps publish" ,
100
100
"start" : " webpack-dev-server --progress" ,
101
101
"fresh" : " rm -rf node_modules && yarn install" ,
102
102
"test" : " npm run test:jest && npm run test:cypress" ,
103
103
"test:jest" : " jest --coverage" ,
104
+ "e2e" : " concurrently --kill-others --success=first --names 'SERVER,E2E' 'yarn start' 'yarn test:cypress'" ,
104
105
"test:cypress" : " cypress run --spec ./cypress/integration/select_spec.js" ,
105
106
"test:cypress-watch" : " node ./node_modules/.bin/cypress open" ,
106
107
"precommit" : " flow check && lint-staged"
You can’t perform that action at this time.
0 commit comments