2019-10-01 23:34:35 -05:00
|
|
|
version: 2.1
|
2018-06-03 08:50:44 -05:00
|
|
|
|
2019-10-01 23:34:35 -05:00
|
|
|
executors:
|
|
|
|
node_latest_browser:
|
2018-06-03 08:50:44 -05:00
|
|
|
docker:
|
2019-10-01 15:31:22 -05:00
|
|
|
- image: circleci/node:latest-browsers
|
2019-10-01 23:34:35 -05:00
|
|
|
node_latest:
|
2018-06-03 08:50:44 -05:00
|
|
|
docker:
|
2019-12-14 01:53:59 -05:00
|
|
|
- image: circleci/node:13
|
|
|
|
node_lts_12:
|
2018-06-03 08:50:44 -05:00
|
|
|
docker:
|
2019-12-14 01:53:59 -05:00
|
|
|
- image: circleci/node:12
|
|
|
|
node_lts_10:
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:10
|
2019-10-01 23:34:35 -05:00
|
|
|
default_executor: node_latest
|
|
|
|
|
|
|
|
aliases:
|
|
|
|
- &repo_path
|
|
|
|
~/verdaccio
|
|
|
|
- &defaults
|
|
|
|
working_directory: *repo_path
|
2018-06-03 08:50:44 -05:00
|
|
|
- &yarn_cache_key
|
|
|
|
yarn-sha-{{ checksum "yarn.lock" }}
|
2019-10-01 15:31:22 -05:00
|
|
|
- &coverage_key
|
|
|
|
coverage-{{ .Branch }}-{{ .Revision }}
|
2018-06-30 10:30:04 -05:00
|
|
|
- &ignore_non_dev_branches
|
2018-06-03 08:50:44 -05:00
|
|
|
filters:
|
2018-06-12 03:28:55 -05:00
|
|
|
tags:
|
|
|
|
only: /.*/
|
2018-06-03 08:50:44 -05:00
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- gh-pages
|
|
|
|
- l10n_master
|
|
|
|
- /release\/.*/
|
|
|
|
|
2019-10-01 23:34:35 -05:00
|
|
|
commands:
|
|
|
|
restore_repo:
|
|
|
|
description: Restore repository from workspace
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: *repo_path
|
|
|
|
run_test:
|
|
|
|
description: Run test and functional test
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Test
|
|
|
|
command: yarn run test
|
|
|
|
- run:
|
|
|
|
name: Functional test
|
|
|
|
command: yarn test:functional
|
2019-10-05 09:29:50 -05:00
|
|
|
- store_test_results:
|
|
|
|
path: reports/
|
2019-10-01 23:34:35 -05:00
|
|
|
|
2018-06-03 08:50:44 -05:00
|
|
|
jobs:
|
|
|
|
prepare:
|
|
|
|
<<: *defaults
|
2019-10-01 23:34:35 -05:00
|
|
|
executor: default_executor
|
2018-06-03 08:50:44 -05:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: *yarn_cache_key
|
|
|
|
- run:
|
2019-10-01 15:31:22 -05:00
|
|
|
name: Install dependencies
|
|
|
|
command: yarn install --no-progress --pure-lockfile
|
2018-06-03 08:50:44 -05:00
|
|
|
- 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
|
2018-11-17 05:54:20 -05:00
|
|
|
- persist_to_workspace:
|
2019-10-01 15:31:22 -05:00
|
|
|
root: *repo_path
|
2018-06-03 08:50:44 -05:00
|
|
|
paths:
|
2018-11-17 05:54:20 -05:00
|
|
|
- ./*
|
2018-06-03 08:50:44 -05:00
|
|
|
|
2019-10-01 15:31:22 -05:00
|
|
|
test_node_latest:
|
2018-06-03 08:50:44 -05:00
|
|
|
<<: *defaults
|
2019-10-01 23:34:35 -05:00
|
|
|
executor: node_latest
|
2018-06-03 08:50:44 -05:00
|
|
|
steps:
|
2019-10-01 23:34:35 -05:00
|
|
|
- restore_repo
|
|
|
|
- run_test
|
2019-10-01 15:31:22 -05:00
|
|
|
- save_cache:
|
|
|
|
key: *coverage_key
|
|
|
|
paths:
|
|
|
|
- coverage
|
2019-12-14 01:53:59 -05:00
|
|
|
test_node_lts_12:
|
2019-04-28 17:20:26 -05:00
|
|
|
<<: *defaults
|
2019-12-14 01:53:59 -05:00
|
|
|
executor: node_lts_12
|
|
|
|
steps:
|
|
|
|
- restore_repo
|
|
|
|
- run_test
|
|
|
|
test_node_lts_10:
|
|
|
|
<<: *defaults
|
|
|
|
executor: node_lts_10
|
2019-04-28 17:20:26 -05:00
|
|
|
steps:
|
2019-10-01 23:34:35 -05:00
|
|
|
- restore_repo
|
|
|
|
- run_test
|
2018-06-03 08:50:44 -05:00
|
|
|
test_e2e:
|
|
|
|
<<: *defaults
|
2019-10-01 23:34:35 -05:00
|
|
|
executor: node_latest_browser
|
2018-06-03 08:50:44 -05:00
|
|
|
steps:
|
2019-10-01 23:34:35 -05:00
|
|
|
- restore_repo
|
2018-06-03 08:50:44 -05:00
|
|
|
- run:
|
|
|
|
name: Test End-to-End
|
|
|
|
command: yarn run test:e2e
|
2019-10-01 15:31:22 -05:00
|
|
|
|
2018-06-03 08:50:44 -05:00
|
|
|
coverage:
|
|
|
|
<<: *defaults
|
2019-10-01 23:34:35 -05:00
|
|
|
executor: default_executor
|
2018-06-03 08:50:44 -05:00
|
|
|
steps:
|
2019-10-01 23:34:35 -05:00
|
|
|
- restore_repo
|
2018-06-09 11:19:43 -05:00
|
|
|
- restore_cache:
|
|
|
|
key: *coverage_key
|
2018-06-03 08:50:44 -05:00
|
|
|
- run:
|
|
|
|
name: Publish coverage
|
|
|
|
command: yarn run coverage:publish
|
2018-06-09 11:19:43 -05:00
|
|
|
- store_artifacts:
|
|
|
|
path: coverage
|
2018-06-03 08:50:44 -05:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
workflow:
|
|
|
|
jobs:
|
|
|
|
- prepare:
|
2018-06-30 10:30:04 -05:00
|
|
|
<<: *ignore_non_dev_branches
|
2019-10-01 15:31:22 -05:00
|
|
|
- test_node_latest:
|
2018-06-03 08:50:44 -05:00
|
|
|
requires:
|
|
|
|
- prepare
|
2018-06-30 10:30:04 -05:00
|
|
|
<<: *ignore_non_dev_branches
|
2019-12-14 01:53:59 -05:00
|
|
|
- test_node_lts_12:
|
|
|
|
requires:
|
|
|
|
- prepare
|
|
|
|
<<: *ignore_non_dev_branches
|
|
|
|
- test_node_lts_10:
|
2018-06-03 08:50:44 -05:00
|
|
|
requires:
|
|
|
|
- prepare
|
2018-06-30 10:30:04 -05:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 08:50:44 -05:00
|
|
|
- test_e2e:
|
|
|
|
requires:
|
|
|
|
- prepare
|
2019-12-14 01:53:59 -05:00
|
|
|
- test_node_latest
|
|
|
|
- test_node_lts_10
|
|
|
|
- test_node_lts_12
|
2018-06-30 10:30:04 -05:00
|
|
|
<<: *ignore_non_dev_branches
|
2018-06-03 08:50:44 -05:00
|
|
|
- coverage:
|
|
|
|
requires:
|
2019-12-14 01:53:59 -05:00
|
|
|
- test_e2e
|
2018-06-30 10:30:04 -05:00
|
|
|
<<: *ignore_non_dev_branches
|