Nuxt/.circleci/config.yml

104 lines
1.9 KiB
YAML
Raw Normal View History

2017-10-28 21:31:01 +00:00
version: 2
2018-03-19 07:16:11 +00:00
defaults: &defaults
2018-03-19 07:27:08 +00:00
working_directory: ~/project/nuxt
2018-03-19 07:16:11 +00:00
docker:
- image: banian/node-headless-chrome
2017-10-28 21:31:01 +00:00
jobs:
2018-03-19 07:37:52 +00:00
setup:
2018-03-19 07:16:11 +00:00
<<: *defaults
2017-10-28 21:31:01 +00:00
steps:
# Checkout repository
- checkout
# Restore cache
- restore_cache:
key: yarn-{{ checksum "yarn.lock" }}
# Install dependencies
- run:
name: Install Dependencies
command: NODE_ENV=dev yarn
# Keep cache
- save_cache:
key: yarn-{{ checksum "yarn.lock" }}
paths:
- "node_modules"
2018-03-19 07:27:08 +00:00
# Persist files
- persist_to_workspace:
root: ~/project
paths:
- nuxt
2018-03-19 07:16:11 +00:00
lint:
2018-03-19 07:21:50 +00:00
<<: *defaults
steps:
2018-03-19 07:27:08 +00:00
- attach_workspace:
2018-03-19 07:30:03 +00:00
at: ~/project
2018-03-19 07:21:50 +00:00
- run:
2018-03-19 07:16:11 +00:00
name: ESLint
command: yarn lint
2017-11-24 16:17:27 +00:00
2018-03-19 07:16:11 +00:00
build:
2018-03-19 07:21:50 +00:00
<<: *defaults
steps:
2018-03-19 07:27:08 +00:00
- attach_workspace:
2018-03-19 07:30:03 +00:00
at: ~/project
2018-03-19 07:21:50 +00:00
- run:
name: Build Fixtures
command: yarn build-fixtures
2018-03-19 07:37:52 +00:00
- persist_to_workspace:
root: ~/project
paths:
- nuxt
2018-03-19 07:16:11 +00:00
test:
2018-03-19 07:21:50 +00:00
<<: *defaults
steps:
2018-03-19 07:27:08 +00:00
- attach_workspace:
2018-03-19 07:30:03 +00:00
at: ~/project
2018-03-19 07:21:50 +00:00
- run:
name: Test
command: yarn jest test/
2018-03-19 07:16:11 +00:00
release:
2018-03-19 07:21:50 +00:00
<<: *defaults
steps:
2018-03-19 07:27:08 +00:00
- attach_workspace:
2018-03-19 07:30:03 +00:00
at: ~/project
2018-03-19 07:21:50 +00:00
- run:
2018-03-19 07:30:03 +00:00
name: release
command: |
if [ "${CIRCLE_BRANCH}" == "dev" ]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc
./scripts/release-edge
fi
2018-03-19 07:16:11 +00:00
workflows:
version: 2
2018-03-19 07:37:52 +00:00
setup-and-parallel-test:
2018-03-19 07:16:11 +00:00
jobs:
2018-03-19 07:37:52 +00:00
- setup
2018-03-19 07:16:11 +00:00
- lint:
requires:
2018-03-19 07:37:52 +00:00
- setup
2018-03-19 07:16:11 +00:00
- build:
requires:
2018-03-19 07:37:52 +00:00
- setup
2018-03-19 07:16:11 +00:00
- test:
requires:
- build
- release:
requires:
- build
- lint
- test