forked from DTStack/dt-react-monaco-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
51 lines (50 loc) · 1.19 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Read more: https://docs.gitlab.com/12.7/ee/ci/yaml/README.html
cache:
paths:
- node_modules/
stages:
- install
- lint
- lintdoc
- check-types
- test
# 当 merge_requests, master, dev, test 分支时会执行依赖安装
install_dependencies:
stage: install
script:
- npm install --unsafe-perm=true --allow-root
only:
- merge_requests
- /master|(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next|test_/
# 当 merge_requests 执行 eslint 检查
code_quality:
stage: lint
script:
- npm run lint
only:
- merge_requests
- /(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next/
# 当 merge_requests 执行 tsc 类型检查
check_types:
stage: check-types
script:
- npm run check-types
only:
- merge_requests
- /(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next/
# 当 merge_requests 有更时会执行单元测试任务
test:
stage: test
script:
- npm run test
only:
- merge_requests
- /(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next/
#执行 MD 文档校验, 为 doc 或者 master 命名当分支更新时才会触发
doc_quality:
stage: lintdoc
script:
- npm run lint-doc
only:
- /doc(s)|release/
- master