mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-20 05:10:33 +03:00
89 lines
1.7 KiB
YAML
Executable File
89 lines
1.7 KiB
YAML
Executable File
version: 2
|
|
|
|
defaults: &defaults
|
|
working_directory: ~/project
|
|
docker:
|
|
- image: circleci/node:latest
|
|
environment:
|
|
NODE_ENV: test
|
|
|
|
jobs:
|
|
setup:
|
|
<<: *defaults
|
|
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"
|
|
|
|
# Persist workspace
|
|
- persist_to_workspace:
|
|
root: ~/project
|
|
paths:
|
|
- node_modules
|
|
|
|
lint:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: Lint
|
|
command: yarn lint
|
|
|
|
audit:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: Security Audit
|
|
command: yarn audit
|
|
|
|
test-unit:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: Unit Tests
|
|
command: yarn test:unit --coverage && yarn coverage
|
|
|
|
test-e2e:
|
|
docker:
|
|
- image: circleci/node:latest-browsers
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ~/project
|
|
- run:
|
|
name: E2E Tests
|
|
command: yarn test:e2e
|
|
|
|
workflows:
|
|
version: 2
|
|
|
|
commit:
|
|
jobs:
|
|
- setup
|
|
- lint: { requires: [setup] }
|
|
- audit: { requires: [setup] }
|
|
- test-unit: { requires: [lint] }
|
|
- test-e2e: { requires: [lint] }
|