forked from gnes-ai/gnes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
141 lines (134 loc) · 4.21 KB
/
.drone.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#kind: pipeline
#name: default
#
#clone:
# depth: 50
#
#steps:
#
#- name: notify the start on wechat work
# image: byrnedo/alpine-curl
# environment:
# BOT_URL:
# from_secret: BOT_URL
# commands:
# - export MSG_LINK=${DRONE_BUILD_LINK}
# - export MSG_TITLE="⌛🏗 Start a CI pipeline \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_BUILD_NUMBER}\`)"
# - export MSG_CONTENT="submit by [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL), click the link below to see the status"
# - ./shell/push-wechatwork.sh
#
#- name: check commit style
# image: node:alpine
# commands:
# - npm install --global --save-dev @commitlint/config-conventional @commitlint/cli
# - "echo \"module.exports = {extends: ['@commitlint/config-conventional']}\" > commitlint.config.js"
# - echo $DRONE_COMMIT_MESSAGE | commitlint
#
#- name: setup ci environment
# image: gnes/ci-base
# commands:
# - mkdir -p .cache && ln -snf $(pwd)/.cache $HOME/.cache
# - export PIP_DOWNLOAD_CACHE=${pwd}.cache/pip_download_cache && export XDG_CACHE_HOME=${pwd}.cache/pip
# - printf "XDG_CACHE_HOME=$XDG_CACHE_HOME\nPIP_DOWNLOAD_CACHE=$PIP_DOWNLOAD_CACHE\n"
# - cat /proc/cpuinfo | grep flags
# - "python -c 'import tensorflow as tf; print(tf.__version__); a=tf.constant(1, tf.int32); print(tf.Session().run(a))'"
#
#- name: pip-install gnes
# image: gnes/ci-base
# environment:
# GNES_ENV_SET: orange-ci
# commands:
# - pip install -e .[all]
# - pylint gnes/**/*.py --exit-zero
# - python -m unittest tests/*.py
#
#
#- name: notify the sucess on wechat work
# image: byrnedo/alpine-curl
# environment:
# BOT_URL:
# from_secret: BOT_URL
# commands:
# - export MSG_LINK=$DRONE_REPO_LINK
# - export MSG_TITLE="✅😃 All tests passed, good job! \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_BUILD_NUMBER}\`)"
# - export MSG_CONTENT="the branch \`$DRONE_SOURCE_BRANCH\` submit by [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) is ready to merge to master"
# - ./shell/push-wechatwork.sh
#
#
#- name: notify the failure on wechat work
# image: byrnedo/alpine-curl
# environment:
# BOT_URL:
# from_secret: BOT_URL
# commands:
# - export MSG_LINK=$DRONE_BUILD_LINK
# - export MSG_TITLE="❌😥 CI pipeline \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_BUILD_NUMBER}\`) is failed!"
# - export MSG_CONTENT="please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
# - ./shell/push-wechatwork.sh
# when:
# status:
# - failure
#
#trigger:
# branch:
# - master
# event:
# - pull_request
#
#---
kind: pipeline
name: master-coverity
clone:
depth: 50
steps:
- name: notify the start on wechat work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK=${DRONE_BUILD_LINK}
- export MSG_TITLE="⌛📜 Start to generate the coverage report \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_BUILD_NUMBER}\`)"
- export MSG_CONTENT="click the link below to see the status"
- ./shell/push-wechatwork.sh
- name: pip-install gnes
image: gnes/ci-base
environment:
GNES_ENV_SET: orange-ci
CODECOV_TOKEN_PR:
from_secret: CODECOV_TOKEN_PR
commands:
- pip install -e .[all]
- pip install coverage codecov
- python -m unittest discover tests/
- coverage run -m unittest discover -s tests/
- coverage report -m
- codecov --token $CODECOV_TOKEN_PR
- name: notify the sucess on wechat work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK=$DRONE_REPO_LINK
- export MSG_TITLE="✅😃 Report is successfully updated!"
- export MSG_CONTENT="new test coverage score is available"
- ./shell/push-wechatwork.sh
- name: notify the failure on wechat work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK=$DRONE_BUILD_LINK
- export MSG_TITLE="❌😥 Test-coverage is failed!"
- export MSG_CONTENT="please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
- ./shell/push-wechatwork.sh
when:
status:
- failure
trigger:
branch:
- master
event:
- pull_request