|
1 | 1 | version: 2
|
2 |
| -jobs: |
3 |
| - test: |
4 |
| - docker: |
5 |
| - - image: circleci/node:8-browsers |
6 |
| - steps: |
7 |
| - - checkout |
8 |
| - - run: | |
| 2 | + |
| 3 | +node8: &node8 |
| 4 | + working_directory: ~/c3 |
| 5 | + docker: |
| 6 | + - image: circleci/node:8-browsers |
| 7 | + |
| 8 | +node10: &node10 |
| 9 | + working_directory: ~/c3 |
| 10 | + docker: |
| 11 | + - image: circleci/node:10-browsers |
| 12 | + |
| 13 | +restore_modules_cache: &restore_modules_cache |
| 14 | + restore_cache: |
| 15 | + keys: |
| 16 | + - npm-4-{{ checksum "package.json" }} |
| 17 | + # fallback to using the latest cache if no exact match is found |
| 18 | + - npm-4- |
| 19 | + |
| 20 | +save_modules_cache: &save_modules_cache |
| 21 | + save_cache: |
| 22 | + key: npm-4-{{ checksum "package.json" }} |
| 23 | + paths: ./node_modules |
| 24 | + |
| 25 | +install_and_test: &install_and_test |
| 26 | + steps: |
| 27 | + - checkout |
| 28 | + - run: |
| 29 | + name: Display versions |
| 30 | + command: | |
9 | 31 | echo "node $(node -v)"
|
10 | 32 | echo "npm v$(npm --version)"
|
11 | 33 | echo "$(google-chrome --version)"
|
12 |
| - - restore_cache: |
13 |
| - key: npm-3-{{ checksum "package.json" }} |
14 |
| - - run: npm install |
15 |
| - - save_cache: |
16 |
| - key: npm-3-{{ checksum "package.json" }} |
17 |
| - paths: |
18 |
| - - ./node_modules |
19 |
| - - run: npm test |
20 |
| - - run: npm run codecov |
21 |
| - - store_artifacts: |
22 |
| - path: htdocs |
23 |
| - destination: htdocs |
24 |
| - - run: npx status-back -s -c circleci/htdocs -r c3js/c3 "preview build succes!" "https://${CIRCLE_BUILD_NUM}-11496279-gh.circle-artifacts.com/0/htdocs/index.html" |
| 34 | + - *restore_modules_cache |
| 35 | + - run: |
| 36 | + name: Installing Dependencies |
| 37 | + command: npm install |
| 38 | + - *save_modules_cache |
| 39 | + - run: npm test |
| 40 | + - run: npm run codecov |
| 41 | + - store_artifacts: |
| 42 | + path: htdocs |
| 43 | + destination: htdocs |
| 44 | + - run: npx status-back -s -c circleci/htdocs -r c3js/c3 "preview build succes!" "https://${CIRCLE_BUILD_NUM}-11496279-gh.circle-artifacts.com/0/htdocs/index.html" |
| 45 | + |
| 46 | +jobs: |
| 47 | + test_on_node8: |
| 48 | + <<: *node8 |
| 49 | + <<: *install_and_test |
| 50 | + |
| 51 | + test_on_node10: |
| 52 | + <<: *node10 |
| 53 | + <<: *install_and_test |
| 54 | + |
25 | 55 | docs:
|
26 | 56 | docker:
|
27 | 57 | - image: circleci/ruby:2.4-node
|
28 | 58 | env:
|
29 | 59 | BUNDLE_PATH: vendor/bundle
|
30 | 60 | steps:
|
31 | 61 | - checkout
|
32 |
| - |
33 | 62 | - restore_cache:
|
34 | 63 | key: deps-bundle-{{ checksum "Gemfile.lock" }}
|
35 | 64 | - run: bundle install
|
36 | 65 | - save_cache:
|
37 | 66 | key: deps-bundle-{{ checksum "Gemfile.lock" }}
|
38 | 67 | paths:
|
39 | 68 | - vendor/bundle
|
40 |
| - |
41 |
| - - restore_cache: |
42 |
| - key: npm-3-{{ checksum "package.json" }} |
| 69 | + - *restore_modules_cache |
43 | 70 | - run: npm install
|
44 |
| - - save_cache: |
45 |
| - key: npm-3-{{ checksum "package.json" }} |
46 |
| - paths: |
47 |
| - - ./node_modules |
48 |
| - |
| 71 | + - *save_modules_cache |
49 | 72 | - run: npm run build
|
50 | 73 | - run: npm run copy-to-docs
|
51 | 74 | - run: npm run build:docs
|
52 | 75 | - store_artifacts:
|
53 | 76 | path: build
|
54 | 77 | destination: docs
|
| 78 | + |
55 | 79 | workflows:
|
56 | 80 | version: 2
|
57 | 81 | test:
|
58 | 82 | jobs:
|
59 |
| - - test |
| 83 | + - test_on_node8 |
| 84 | + - test_on_node10 |
60 | 85 | - docs
|
0 commit comments