Skip to content

Commit 66a3767

Browse files
committed
ci: update pipline
1 parent b46b577 commit 66a3767

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.gitlab-ci.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,44 @@
11
# Read more: https://docs.gitlab.com/12.7/ee/ci/yaml/README.html
2+
23
cache:
34
paths:
45
- node_modules/
6+
7+
# 当 merge_requests, master, dev, test 分支时会执行依赖安装
8+
before_script:
9+
- "npm install --unsafe-perm=true --allow-root"
10+
511
stages:
6-
- install
712
- lint
813
- lintdoc
914
- check-types
1015
- test
16+
- build_deploy
1117

12-
# 当 merge_requests, master, dev, test 分支时会执行依赖安装
13-
install_dependencies:
14-
stage: install
15-
script:
16-
- npm install --unsafe-perm=true --allow-root
17-
only:
18-
- merge_requests
19-
- /master|(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next|test_/
2018
# 当 merge_requests 执行 eslint 检查
2119
code_quality:
2220
stage: lint
2321
script:
2422
- npm run lint
2523
only:
2624
- merge_requests
27-
- /(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next/
25+
2826
# 当 merge_requests 执行 tsc 类型检查
2927
check_types:
3028
stage: check-types
3129
script:
3230
- npm run check-types
3331
only:
3432
- merge_requests
35-
- /(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next/
33+
3634
# 当 merge_requests 有更时会执行单元测试任务
3735
test:
3836
stage: test
3937
script:
4038
- npm run test
4139
only:
4240
- merge_requests
43-
- /(f|F)ix|(d|D)ev_|(f|F)eat|(i|I)ssue|ref|perf|next/
41+
4442
#执行 MD 文档校验, 为 doc 或者 master 命名当分支更新时才会触发
4543
doc_quality:
4644
stage: lintdoc
@@ -49,3 +47,10 @@ doc_quality:
4947
only:
5048
- /doc(s)|release/
5149
- master
50+
51+
build_deploy: # Deploy master to Github Page
52+
stage: build_deploy
53+
script:
54+
- npm run deploy-storybook
55+
only:
56+
- /master/

0 commit comments

Comments
 (0)