2018-06-03 15:50:44 +02:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
aliases:
|
|
|
|
- &defaults
|
|
|
|
working_directory: ~/verdaccio
|
|
|
|
- &node6_executor
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:6
|
|
|
|
- &node8_executor
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:8
|
|
|
|
- &node9_executor
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:9
|
|
|
|
- &node9_browser_executor
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:9-browsers
|
|
|
|
- &node10_executor
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:10
|
|
|
|
- &default_executor
|
|
|
|
<<: *node9_executor
|
|
|
|
- &repo_key
|
|
|
|
repo-{{ .Branch }}-{{ .Revision }}
|
2018-06-09 18:19:43 +02:00
|
|
|
- &coverage_key
|
|
|
|
coverage-{{ .Branch }}-{{ .Revision }}
|
2018-06-03 15:50:44 +02:00
|
|
|
- &base_config_key
|
|
|
|
base-config-{{ .Branch }}-{{ .Revision }}
|
|
|
|
- &yarn_cache_key
|
|
|
|
yarn-sha-{{ checksum "yarn.lock" }}
|
|
|
|
- &restore_repo
|
|
|
|
restore_cache:
|
|
|
|
keys:
|
|
|
|
- *repo_key
|
2018-06-30 17:30:04 +02:00
|
|
|
- &ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
filters:
|
2018-06-12 10:28:55 +02:00
|
|
|
tags:
|
|
|
|
only: /.*/
|
2018-06-03 15:50:44 +02:00
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- gh-pages
|
|
|
|
- l10n_master
|
|
|
|
- /release\/.*/
|
2018-06-30 17:30:04 +02:00
|
|
|
- &execute_on_release
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /(v)?[0-9]+(\.[0-9]+)*/
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /.*/
|
2018-06-03 15:50:44 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
prepare:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *default_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: *base_config_key
|
|
|
|
- run:
|
|
|
|
name: 'Base environment setup'
|
|
|
|
command: |
|
|
|
|
git config --global user.email "verdacciobot@users.noreply.github.com"
|
|
|
|
git config --global user.name "Verdaccio bot for Deployments"
|
|
|
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
|
|
echo "machine github.com login verdacciobot password $GITHUB_TOKEN" > ~/.netrc
|
|
|
|
- save_cache:
|
|
|
|
key: *base_config_key
|
|
|
|
paths:
|
|
|
|
- ~/.npmrc
|
|
|
|
- ~/.gitconfig
|
|
|
|
- ~/.netrc
|
|
|
|
- restore_cache:
|
|
|
|
key: *yarn_cache_key
|
|
|
|
- run:
|
|
|
|
name: Install Js dependencies
|
|
|
|
command: yarn install --no-progress
|
|
|
|
- run:
|
|
|
|
name: Prepare CI
|
|
|
|
command: yarn run pre:ci
|
|
|
|
- run:
|
|
|
|
name: Build project
|
|
|
|
command: yarn run code:build
|
|
|
|
- save_cache:
|
|
|
|
key: *yarn_cache_key
|
|
|
|
paths:
|
|
|
|
- ~/.yarn
|
|
|
|
- ~/.cache/yarn
|
|
|
|
- node_modules
|
|
|
|
- save_cache:
|
|
|
|
key: *repo_key
|
|
|
|
paths:
|
|
|
|
- ~/verdaccio
|
|
|
|
|
|
|
|
test_node6:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *node6_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- run:
|
|
|
|
name: Test with Node 6
|
|
|
|
command: yarn run test
|
|
|
|
|
|
|
|
test_node8:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *node8_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- run:
|
|
|
|
name: Test with Node 8
|
2018-07-03 21:39:57 +02:00
|
|
|
command: |
|
|
|
|
yarn test
|
|
|
|
yarn test:functional
|
2018-06-03 15:50:44 +02:00
|
|
|
|
|
|
|
test_node9:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *default_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- run:
|
|
|
|
name: Test with Node 9
|
2018-07-03 21:39:57 +02:00
|
|
|
command: |
|
|
|
|
yarn test
|
|
|
|
yarn test:functional
|
2018-06-09 18:19:43 +02:00
|
|
|
- save_cache:
|
|
|
|
key: *coverage_key
|
|
|
|
paths:
|
|
|
|
- coverage
|
2018-06-03 15:50:44 +02:00
|
|
|
|
|
|
|
test_node10:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *node10_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- run:
|
|
|
|
name: Test with Node 10
|
2018-07-03 21:39:57 +02:00
|
|
|
command: |
|
|
|
|
yarn run test
|
|
|
|
yarn test:functional
|
2018-06-03 15:50:44 +02:00
|
|
|
|
|
|
|
test_e2e:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *node9_browser_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- run:
|
|
|
|
name: Test End-to-End
|
|
|
|
command: yarn run test:e2e
|
|
|
|
|
2018-07-28 16:59:54 +02:00
|
|
|
test_size:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *default_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- run:
|
|
|
|
name: Test size
|
|
|
|
command: yarn test:size
|
|
|
|
|
2018-06-03 15:50:44 +02:00
|
|
|
coverage:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *default_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
2018-06-09 18:19:43 +02:00
|
|
|
- restore_cache:
|
|
|
|
key: *coverage_key
|
2018-06-03 15:50:44 +02:00
|
|
|
- run:
|
|
|
|
name: Publish coverage
|
|
|
|
command: yarn run coverage:publish
|
2018-06-09 18:19:43 +02:00
|
|
|
- store_artifacts:
|
|
|
|
path: coverage/clover.xml
|
|
|
|
prefix: tests
|
|
|
|
- store_artifacts:
|
|
|
|
path: coverage
|
|
|
|
prefix: coverage
|
|
|
|
- store_test_results:
|
|
|
|
path: coverage/clover.xml
|
2018-06-03 15:50:44 +02:00
|
|
|
|
|
|
|
publish_gh_pages:
|
|
|
|
<<: *defaults
|
|
|
|
<<: *default_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- restore_cache:
|
|
|
|
key: *base_config_key
|
|
|
|
- run:
|
|
|
|
name: Publish gh-pages
|
|
|
|
command: |
|
|
|
|
cd website
|
|
|
|
yarn install
|
|
|
|
GIT_USER=verdacciobot USE_SSH=false yarn run publish-gh-pages
|
|
|
|
|
2018-06-12 10:28:55 +02:00
|
|
|
publish_package:
|
2018-06-03 15:50:44 +02:00
|
|
|
<<: *defaults
|
|
|
|
<<: *default_executor
|
|
|
|
steps:
|
|
|
|
- *restore_repo
|
|
|
|
- restore_cache:
|
|
|
|
key: *base_config_key
|
|
|
|
- run:
|
|
|
|
name: Publish
|
|
|
|
command: scripts/publish.sh
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
workflow:
|
|
|
|
jobs:
|
|
|
|
- prepare:
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
- test_node6:
|
|
|
|
requires:
|
|
|
|
- prepare
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
- test_node8:
|
|
|
|
requires:
|
|
|
|
- prepare
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
- test_node9:
|
|
|
|
requires:
|
|
|
|
- prepare
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
- test_node10:
|
|
|
|
requires:
|
|
|
|
- prepare
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
- test_e2e:
|
|
|
|
requires:
|
|
|
|
- prepare
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-07-28 16:59:54 +02:00
|
|
|
- test_size:
|
|
|
|
requires:
|
|
|
|
- prepare
|
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
- coverage:
|
|
|
|
requires:
|
2018-06-09 18:19:43 +02:00
|
|
|
- test_node6
|
|
|
|
- test_node8
|
|
|
|
- test_node9
|
|
|
|
- test_node10
|
|
|
|
- test_e2e
|
2018-07-28 16:59:54 +02:00
|
|
|
- test_size
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 15:50:44 +02:00
|
|
|
- publish_gh_pages:
|
|
|
|
requires:
|
|
|
|
- test_node6
|
|
|
|
- test_node8
|
|
|
|
- test_node9
|
|
|
|
- test_node10
|
|
|
|
- test_e2e
|
2018-07-28 16:59:54 +02:00
|
|
|
- test_size
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *execute_on_release
|
2018-06-12 10:28:55 +02:00
|
|
|
- publish_package:
|
2018-06-03 15:50:44 +02:00
|
|
|
requires:
|
2018-06-09 18:19:43 +02:00
|
|
|
- coverage
|
2018-06-03 15:50:44 +02:00
|
|
|
- publish_gh_pages
|
2018-06-30 17:30:04 +02:00
|
|
|
<<: *execute_on_release
|