Skip to content

Commit

Permalink
chore: Run build/test/release on CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Oct 9, 2020
1 parent e7878dc commit a1b6b2b
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 1 deletion.
195 changes: 195 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,195 @@
version: 2.1
orbs:
node: circleci/node@3.0.1

workflows:
main:
jobs:
- lint:
version: 14
- test:
version: 14
- test:
version: 12
- test:
version: 10
- build:
version: 14
- deploy-npm:
requires:
- lint
- test
- build
version: 14
context: tsed
filters:
branches:
only: /^(production|alpha|beta|rc)$/
- deploy-ghpages:
requires:
- deploy-npm
version: 14
context: tsed
filters:
branches:
only: /^(production|alpha|beta|rc)$/
- deploy-examples:
requires:
- deploy-npm
version: 14
context: tsed
filters:
branches:
only: /^(production|beta|rc)$/

commands:
yarn-install:
parameters:
version:
type: string
description: "Yarn install"
steps:
- node/install:
install-yarn: true
node-version: << parameters.version >>
- version-info
- run: node --version
- run: npm --version
- run: yarn --version

jobs:
#######################################################################
# JOB: LINT
#######################################################################
lint:
machine: true
parameters:
version:
type: string
steps:
- checkout
- yarn-install:
node-version: << parameters.version >>
- run:
name: Run linter
command: |
mkdir -p reports/eslint
yarn test:lint:junit
- store_test_results:
path: reports
- store_artifacts:
path: ./reports
#######################################################################
# JOB: TEST
#######################################################################
test:
machine: true
parameters:
version:
type: string
steps:
- checkout
- yarn-install:
node-version: << parameters.version >>
- run:
name: Run unit test
command: |
mkdir -p reports/mocha
yarn test:coverage:junit
- store_test_results:
path: reports
- store_artifacts:
path: ./reports
#######################################################################
# JOB: BUILD
#######################################################################
build:
machine: true
parameters:
version:
type: string
steps:
- checkout
- yarn-install:
node-version: << parameters.version >>
- run:
name: Run unit test
command: yarn test:coverage
- store_test_results:
path: reports
- store_artifacts:
path: ./reports
- persist_to_workspace:
root: .
paths:
- packages/*/lib
#######################################################################
# JOB: DEPLOY NPM
#######################################################################
deploy-npm:
machine: true
parameters:
version:
type: string
steps:
- checkout
- yarn-install:
node-version: << parameters.version >>
- attach_workspace:
at: .
- run:
name: Release
command: yarn release
- persist_to_workspace:
root: .
paths:
- packages/*/lib
- package.json
- lerna.json
- packages/*/package.json
#######################################################################
# JOB: DEPLOY WEBSITE
#######################################################################
deploy-ghpages:
machine: true
parameters:
version:
type: string
steps:
- checkout
- yarn-install:
node-version: << parameters.version >>
- attach_workspace:
at: .
- run:
name: Configure
command: monorepo ci configure
- run:
name: Fetch
command: git fetch --quiet
- run:
name: Publish GHPages
command: yarn docs:publish
#######################################################################
# JOB: DEPLOY EXAMPLES
#######################################################################
deploy-examples:
machine: true
parameters:
version:
type: string
steps:
- checkout
- yarn-install:
node-version: << parameters.version >>
- attach_workspace:
at: .
- run:
name: Configure
command: monorepo ci configure
- run:
name: Fetch
command: git fetch --quiet
- run:
name: Publish Examples
command: yarn examples:publish
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -30,6 +30,7 @@ build/Release
node_modules

.idea
reports

# Typings
typings/
Expand Down
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -9,7 +9,9 @@
"test": "yarn clean && yarn test:lint && yarn test:coverage",
"test:unit": "cross-env NODE_ENV=test mocha",
"test:coverage": "cross-env NODE_ENV=test nyc mocha",
"test:coverage:junit": "cross-env NODE_ENV=test nyc mocha -- --reporter mocha-junit-reporter --reporter-options mochaFile=./reports/mocha/test-results-unit.xml",
"test:lint": "eslint packages --ext .ts",
"test:lint:junit": "eslint packages --ext .ts --format junit --output-file ./reports/eslint/test-results-eslint.xml",
"test:lint:fix": "eslint packages --ext .ts --fix",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"build": "monorepo build",
Expand Down Expand Up @@ -107,6 +109,7 @@
"husky": "4.3.0",
"lint-staged": "10.4.0",
"mocha": "8.1.3",
"mocha-junit-reporter": "2.0.0",
"nyc": "15.1.0",
"prettier": "2.1.2",
"proxyquire": "2.1.3",
Expand Down
37 changes: 36 additions & 1 deletion yarn.lock
Expand Up @@ -4828,6 +4828,11 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==

charenc@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=

check-error@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
Expand Down Expand Up @@ -5731,6 +5736,11 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
shebang-command "^2.0.0"
which "^2.0.1"

crypt@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=

crypto-browserify@^3.11.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
Expand Down Expand Up @@ -8967,7 +8977,7 @@ is-binary-path@~2.1.0:
dependencies:
binary-extensions "^2.0.0"

is-buffer@^1.1.5:
is-buffer@^1.1.5, is-buffer@~1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
Expand Down Expand Up @@ -10613,6 +10623,15 @@ md5.js@^1.3.4:
inherits "^2.0.1"
safe-buffer "^5.1.2"

md5@^2.1.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f"
integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==
dependencies:
charenc "0.0.2"
crypt "0.0.2"
is-buffer "~1.1.6"

mdn-data@2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b"
Expand Down Expand Up @@ -10947,6 +10966,17 @@ mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.0, mkdir
dependencies:
minimist "^1.2.5"

mocha-junit-reporter@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-2.0.0.tgz#3bf990fce7a42c0d2b718f188553a25d9f24b9a2"
integrity sha512-20HoWh2HEfhqmigfXOKUhZQyX23JImskc37ZOhIjBKoBEsb+4cAFRJpAVhFpnvsztLklW/gFVzsrobjLwmX4lA==
dependencies:
debug "^2.2.0"
md5 "^2.1.0"
mkdirp "~0.5.1"
strip-ansi "^4.0.0"
xml "^1.0.0"

mocha@8.1.3:
version "8.1.3"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.1.3.tgz#5e93f873e35dfdd69617ea75f9c68c2ca61c2ac5"
Expand Down Expand Up @@ -16672,6 +16702,11 @@ xml2js@^0.4.17:
sax ">=0.6.0"
xmlbuilder "~11.0.0"

xml@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=

xmlbuilder@~11.0.0:
version "11.0.1"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3"
Expand Down

0 comments on commit a1b6b2b

Please sign in to comment.