Skip to content

Commit

Permalink
ci: improve circle ci (ant-design#218)
Browse files Browse the repository at this point in the history
* ci: improve circle ci

* feat: update

* fix: remove --hoist option for lerna

* feat: update

* feat: update
  • Loading branch information
vagusX committed Jan 5, 2020
1 parent ec482cd commit 4322077
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 57 deletions.
104 changes: 72 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,83 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:

references:
container_config: &container_config
docker:
# specify the version you desire here
- image: circleci/node:8
- image: circleci/node:lts
working_directory: ~/ant-design-icons

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
attach_workspace: &attach_workspace
attach_workspace:
at: ~/ant-design-icons

working_directory: ~/repo
workflow: &workflow
jobs:
- setup:
filters:
branches:
ignore: gh-pages
- icons-svg:
requires:
- setup
- icons-react:
requires:
- setup
- icons-svg

jobs:
setup:
<<: *container_config
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
- run: node -v
- run: yarn -v
- run: yarn
- run: yarn bootstrap
- run:
command: |
set +eo
yarn list
true
- persist_to_workspace:
root: ~/ant-design-icons
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- packages/icons-*/node_modules
- store_artifacts:
path: yarn.lock

- run: yarn run bootstrap
- run: yarn cache clean
icons-svg:
<<: *container_config
steps:
- checkout
- *attach_workspace
- run: yarn icons:generate
- run: yarn icons:build
- run: yarn icons:test
- persist_to_workspace:
root: ~/ant-design-icons
paths:
- packages/icons-svg/es
- packages/icons-svg/lib
- packages/icons-svg/inline-svg

icons-react:
<<: *container_config
steps:
- checkout
- *attach_workspace
- run: yarn react:ci

- run: yarn run lint
- run: yarn run icons:test
- run: yarn run icons:generate
- run: yarn run icons:build
- run: yarn run react:test
workflows:
version: 2
build_test:
<<: *workflow
nightly:
<<: *workflow
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
"scripts": {
"bootstrap": "lerna bootstrap",
"bootstrap:china": "lerna bootstrap --registry=https://registry.npm.taobao.org",
"rn:generate": "lerna run --scope @ant-design/icons-react-native generate",
"icons:generate": "lerna run --scope @ant-design/icons-svg generate",
"posticons:generate": "lerna run --scope @ant-design/icons-react-native generate",
"icons:build": "lerna run --scope @ant-design/icons-svg build",
"icons:test": "lerna run --scope @ant-design/icons-svg test",
"react:compile": "lerna run --scope @ant-design/icons compile",
"react:example": "lerna run --scope @ant-design/icons start",
"react:test": "lerna run --scope @ant-design/icons ci",
"react:ci": "lerna run --scope @ant-design/icons ci",
"lint": "lerna run lint"
},
"devDependencies": {
Expand Down

0 comments on commit 4322077

Please sign in to comment.