Browse Source

chore: dry circleci config

pull/11421/head
Wei Zhu 6 years ago
parent
commit
cc02ebf9d4
  1. 107
      .circleci/config.yml

107
.circleci/config.yml

@ -6,6 +6,10 @@ references:
- image: circleci/node:8 - image: circleci/node:8
working_directory: ~/ant-design working_directory: ~/ant-design
attach_workspace: &attach_workspace
attach_workspace:
at: ~/ant-design
restore_cache: &restore_cache restore_cache: &restore_cache
restore_cache: restore_cache:
keys: keys:
@ -21,26 +25,27 @@ references:
run: ./scripts/install-react.sh run: ./scripts/install-react.sh
jobs: jobs:
lint: setup:
<<: *container_config <<: *container_config
steps: steps:
- checkout
- *restore_cache - *restore_cache
- run: npm install - run: npm install
- run: node -v - run: node -v
- run: npm -v - run: npm -v
- *save_cache - *save_cache
- persist_to_workspace:
root: ~/ant-design
lint:
<<: *container_config
steps:
- *attach_workspace
- run: npm run lint - run: npm run lint
test_dist: test_dist:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- run: npm run dist - run: npm run dist
- run: node ./tests/dekko/dist.test.js - run: node ./tests/dekko/dist.test.js
- run: REACT=16 LIB_DIR=dist npm test - run: REACT=16 LIB_DIR=dist npm test
@ -48,12 +53,7 @@ jobs:
test_lib: test_lib:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- run: npm run compile - run: npm run compile
- run: node ./tests/dekko/lib.test.js - run: node ./tests/dekko/lib.test.js
- run: REACT=16 LIB_DIR=lib npm test - run: REACT=16 LIB_DIR=lib npm test
@ -61,47 +61,27 @@ jobs:
test_es: test_es:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- run: npm run compile - run: npm run compile
- run: REACT=16 LIB_DIR=es npm test - run: REACT=16 LIB_DIR=es npm test
test_dom: test_dom:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- run: REACT=16 npm test -- --coverage - run: REACT=16 npm test -- --coverage
- run: bash <(curl -s https://codecov.io/bash) - run: bash <(curl -s https://codecov.io/bash)
test_node: test_node:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- run: REACT=16 npm run test-node - run: REACT=16 npm run test-node
test_dist_15: test_dist_15:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- *install_react - *install_react
- run: node ./tests/dekko/dist.test.js - run: node ./tests/dekko/dist.test.js
- run: REACT=15 LIB_DIR=dist npm test -u - run: REACT=15 LIB_DIR=dist npm test -u
@ -109,12 +89,7 @@ jobs:
test_lib_15: test_lib_15:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- *install_react - *install_react
- run: npm run compile - run: npm run compile
- run: node ./tests/dekko/lib.test.js - run: node ./tests/dekko/lib.test.js
@ -123,12 +98,7 @@ jobs:
test_es_15: test_es_15:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- *install_react - *install_react
- run: npm run compile - run: npm run compile
- run: REACT=15 LIB_DIR=es npm test - run: REACT=15 LIB_DIR=es npm test
@ -136,12 +106,7 @@ jobs:
test_dom_15: test_dom_15:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- *install_react - *install_react
- run: REACT=15 npm test -- --coverage - run: REACT=15 npm test -- --coverage
- run: bash <(curl -s https://codecov.io/bash) - run: bash <(curl -s https://codecov.io/bash)
@ -149,12 +114,7 @@ jobs:
test_node_15: test_node_15:
<<: *container_config <<: *container_config
steps: steps:
- checkout - *attach_workspace
- *restore_cache
- run: npm install
- run: node -v
- run: npm -v
- *save_cache
- *install_react - *install_react
- run: REACT=15 npm run test-node - run: REACT=15 npm run test-node
@ -162,14 +122,37 @@ workflows:
version: 2 version: 2
build-test: build-test:
jobs: jobs:
- setup
- lint: - lint:
requires:
- setup
- test-dist: - test-dist:
requires:
- setup
- test-lib: - test-lib:
requires:
- setup
- test-es: - test-es:
requires:
- setup
- test-dom: - test-dom:
requires:
- setup
- test-node: - test-node:
requires:
- setup
- test-dist-15: - test-dist-15:
requires:
- setup
- test-lib-15: - test-lib-15:
requires:
- setup
- test-es-15: - test-es-15:
requires:
- setup
- test-dom-15: - test-dom-15:
requires:
- setup
- test-node-15: - test-node-15:
requires:
- setup

Loading…
Cancel
Save