ci: use workflow to parallelize jobs

This commit is contained in:
Evan You 2019-12-20 09:40:34 -05:00
parent 362831d8ab
commit 9560ab72f8

View File

@ -1,37 +1,64 @@
version: 2 version: 2
jobs:
build: defaults: &defaults
docker: docker:
- image: vuejs/ci - image: vuejs/ci
working_directory: ~/project/vue
working_directory: ~/repo jobs:
install:
<<: *defaults
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- v1-dependencies-{{ checksum "yarn.lock" }} - v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies- - v1-dependencies-
- run: - run:
name: Install Dependencies name: Install Dependencies
command: yarn --frozen-lockfile command: yarn --frozen-lockfile
- save_cache: - save_cache:
paths: paths:
- node_modules - node_modules
- ~/.cache/yarn - ~/.cache/yarn
key: v1-dependencies-{{ checksum "yarn.lock" }} key: v1-dependencies-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: ~/project
paths:
- vue
- run: test:
name: Run Tests <<: *defaults
command: yarn test --ci --runInBand steps:
- attach_workspace:
at: ~/project
- run: yarn test --ci --runInBand
- run: test-dts:
name: Test d.ts <<: *defaults
command: yarn test-dts steps:
- attach_workspace:
at: ~/project
- run: yarn test-dts
- run: check-size:
name: Check size <<: *defaults
command: yarn size steps:
- attach_workspace:
at: ~/project
- run: yarn size
workflows:
version: 2
ci:
jobs:
- install
- test:
requires:
- install
- test-dts:
requires:
- install
- check-size:
requires:
- install