未验证 提交 eb802831 编写于 作者: V Vinayak Kulkarni 提交者: GitHub

feat: use GitHub actions instead of CircleCI (#2417)

上级 7ca9fbc7
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
defaults: &defaults
working_directory: ~/project
docker:
- image: circleci/node:latest
jobs:
#------------------------------------------------------------
# 1. Install dependencies
#------------------------------------------------------------
install-dependencies:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- v1-deps
- run:
name: 'Install dependencies'
command: yarn --frozen-lockfile --non-interactive
- save_cache:
key: v1-deps-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- persist_to_workspace:
root: ~/project
paths:
- node_modules
- packages/*/node_modules
- packages/@vuepress/*/node_modules
#------------------------------------------------------------
# 2. Run parallel jobs:
# => tsc
# => tests
# => linter
# => docs linter
#------------------------------------------------------------
run-tsc:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: 'Run tsc'
command: yarn tsc
- persist_to_workspace:
root: ~/project
paths:
- packages/@vuepress/shared-utils/lib
run-tests:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: 'Run tests'
command: yarn test
run-linter-check:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: 'Run linter'
command: yarn lint
run-docs-linter-check:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: 'Run md linter'
command: yarn workspace docs lint-md
#------------------------------------------------------------
# 3. Build VuePress
#------------------------------------------------------------
build:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: 'Run tests'
command: yarn build
#------------------------------------------------------------
# Workflows
#------------------------------------------------------------
workflows:
version: 2
build:
jobs:
- install-dependencies
- run-linter-check: { requires: [install-dependencies] }
- run-docs-linter-check: { requires: [install-dependencies] }
- run-tsc: { requires: [install-dependencies] }
- run-tests: { requires: [run-tsc] }
- build: { requires: [run-tests, run-linter-check, run-docs-linter-check] }
name: Pull request workflow
on:
pull_request:
jobs:
pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-
${{ runner.os }}-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Run tsc
run: yarn tsc
- name: Run unit tests
run: yarn test
- name: Check linter
run: yarn lint
- name: Check markdown linter
run: yarn workspace docs lint-md
- name: Build vuepress
run: yarn build
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册