-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy path.travis.yml
More file actions
25 lines (25 loc) · 1.04 KB
/
.travis.yml
File metadata and controls
25 lines (25 loc) · 1.04 KB
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
# 指定语言 https://docs.travis-ci.com/user/languages/javascript-with-nodejs/
language: node_js
# 缓存 node_modules 文件夹,不需要每次都下载安装全部 npm 包。
cache:
directories:
- node_modules
# 指定 node 版本
node_js:
- "12"
# 只对指定的分支执行构建 https://docs.travis-ci.com/user/customizing-the-build/#building-specific-branches
branches:
only:
- master
# 要执行的脚本
script:
- npm test
# 配置当构建失败的时候发送通知 https://docs.travis-ci.com/user/notifications
notifications:
# 设置 TravisBuddy,每当 Pull Request 构建失败的时候,TravisBuddy 会收到通知
# 同时会将 构建失败的日志 以评论的形式添加到 Pull Request ,方便 PR 的提交者查看错误原因。
webhooks:
urls:
- https://www.travisbuddy.com/
on_success: never # 构建成功不发送邮件。默认是 change,即默认只有上次失败这次修复的成功构建才会发送邮件
on_failure: always # 构建失败总是发送邮件。默认就是 always