-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathinspection-reusable-pipeline.yml
More file actions
285 lines (255 loc) · 8.59 KB
/
Copy pathinspection-reusable-pipeline.yml
File metadata and controls
285 lines (255 loc) · 8.59 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: REUSABLE INSPECTION SYSTEM TEST PIPELINE
on:
workflow_call:
inputs:
BRANCH:
description: 'BRANCH'
required: true
type: string
COMMIT_ID:
description: 'COMMIT ID'
required: true
type: string
TAR_PATH:
description: 'TAR PATH'
required: true
type: string
BUILD_TYPE:
description: 'BUILD TYPE'
required: true
type: string
LINUX_DISTRO:
description: 'LINUX DISTRO'
required: true
type: string
default: 'centos7'
CLUSTER_NAME:
description: 'CLUSTER NAME'
required: false
type: string
default: ci-admit
IS_SELF_BUILD:
description: 'IS SELF BUILD'
type: string
default: 'false'
INCLUDE_ADMIT:
description: 'RUN ADMIT?'
type: string
default: 'true'
outputs:
CONF_FILE:
description: "DEPLOY CONF"
value: ${{ jobs.deploy.outputs.deploy_conf_file }}
MYSQL_ECI_ID:
description: "MySQL ECI ID"
value: ${{ jobs.SQL-Tester.outputs.MYSQL_ECI_ID }}
permissions:
checks: write
actions: write
contents: write
deployments: write
discussions: write
issues: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
env:
IS_INSPECTION: true
BRANCH: ${{ inputs.BRANCH }}
PR_NUMBER: ${{ inputs.COMMIT_ID }}
TAR_PATH: ${{ inputs.TAR_PATH }}
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
LINUX_DISTRO: ${{ inputs.LINUX_DISTRO }}
CLUSTER_NAME: ${{ inputs.CLUSTER_NAME }}
IS_SELF_BUILD: ${{ inputs.IS_SELF_BUILD }}
INCLUDE_ADMIT: ${{ inputs.INCLUDE_ADMIT }}
jobs:
deploy:
runs-on: [self-hosted, normal]
name: DEPLOY SR
outputs:
fe: ${{steps.deploy_sr.outputs.fe}}
be: ${{steps.deploy_sr.outputs.be}}
be_list: ${{steps.deploy_sr.outputs.be_list}}
deploy_conf_file: ${{steps.apply_resource.outputs.deploy_conf_file}}
steps:
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
- name: Apply for resources
id: apply_resource
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
./bin/elastic-cluster.sh --template ${CLUSTER_NAME} --linuxdistro ${LINUX_DISTRO}
conf_name=/var/local/env/${PR_NUMBER}-${BUILD_TYPE}-${LINUX_DISTRO}-starrocks_deploy.conf
cp conf/starrocks_deploy.conf ${conf_name}
echo "deploy_conf_file=${conf_name}" >> $GITHUB_OUTPUT
- name: Deploy SR
id: deploy_sr
if: always() && steps.apply_resource.outcome == 'success'
run: |
cd ci-tool && source lib/init.sh
echo ${TAR_PATH}
./bin/deploy-cluster.sh -c ${CLUSTER_NAME} --output ${TAR_PATH}
- name: Clean ENV
if: always()
run: |
rm -rf ${{ github.workspace }}/*
SQL-Tester:
runs-on: [ self-hosted, normal ]
name: SQL-Tester
needs:
- deploy
env:
FE_NODE: ${{ needs.deploy.outputs.fe }}
BE_NODE: ${{ needs.deploy.outputs.be }}
outputs:
MYSQL_ECI_ID: ${{steps.run_case.outputs.MYSQL_ECI_ID}}
steps:
- name: CLEAN
run: |
rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }}
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout Code
run: |
git checkout $BRANCH;
git reset ${PR_NUMBER} --hard
- name: Run Case (${{ needs.deploy.outputs.fe }})
id: run_case
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
./bin/run-sql-tester.sh
- name: Prepare Tools
id: prepare-tools
if: success() || failure()
run: |
mkdir -p .actions/nose-report-action
cd .actions/nose-report-action
git clone https://github.com/StarRocks/action-junit-report.git .
- name: Publish SQL-Tester Report
uses: ./.actions/nose-report-action
if: always() && steps.prepare-tools.outcome == 'success'
with:
check_name: SQL-Tester Report (${{ env.BUILD_TYPE }} ${{ env.LINUX_DISTRO }})
fail_on_failure: true
detailed_summary: true
token: ${{ secrets.GITHUB_TOKEN }}
report_paths: 'test/*.xml'
- name: Upload log
uses: actions/upload-artifact@v4
if: always()
with:
name: SQL-Tester Log (${{ env.BUILD_TYPE }} ${{ env.LINUX_DISTRO }})
path: |
test/log/
test/crash_logs/
retention-days: 1
overwrite: true
if-no-files-found: ignore
- name: Clean ENV
if: always()
run: |
rm -rf ${{ github.workspace }}/*
restart-fe:
runs-on: [ self-hosted, normal ]
name: Restart FE
needs:
- deploy
- SQL-Tester
if: always() && needs.deploy.result == 'success'
env:
FE_NODE: ${{ needs.deploy.outputs.fe }}
steps:
- name: CLEAN
run: |
rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }}
- name: Restart FE (${{needs.deploy.outputs.fe}})
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
./bin/restart-fe.sh --repository ${{ github.repository }}
- name: Clean ENV
if: always()
run: |
rm -rf ${{ github.workspace }}/*
restart-be:
runs-on: [ self-hosted, normal ]
name: Restart BE
needs:
- deploy
- SQL-Tester
if: always() && needs.deploy.result == 'success'
timeout-minutes: 20
env:
FE_NODE: ${{ needs.deploy.outputs.fe }}
BE_NODE: ${{ needs.deploy.outputs.be }}
BE_LIST: ${{ needs.deploy.outputs.be_list }}
outputs:
FE_NODE: ${{ needs.deploy.outputs.fe }}
BE_NODE: ${{ needs.deploy.outputs.be }}
steps:
- name: CLEAN
run: |
rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }}
- name: Restart BE (${{needs.deploy.outputs.be_list}})
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
./bin/system-cov-be.sh --pr ${PR_NUMBER} --branch ${BRANCH} --repository ${{ github.repository }} --skip-gcov
- name: Clean ENV
if: always()
run: |
rm -rf ${{ github.workspace }}/*
admit:
runs-on: [ self-hosted, normal ]
name: ADMIT TEST
needs:
- restart-fe
- restart-be
if: always() && env.INCLUDE_ADMIT == 'true' && env.BUILD_TYPE == 'Release' && needs.restart-be.result == 'success' && needs.restart-fe.result == 'success'
timeout-minutes: 40
env:
FE_NODE: ${{ needs.restart-be.outputs.FE_NODE }}
BE_NODE: ${{ needs.restart-be.outputs.BE_NODE }}
steps:
- name: CLEAN
run: |
rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }}
- name: BRANCH INFO
id: branch
run: |
repo="${{ github.repository }}"
bucket_prefix=`echo ${repo%/*} | tr '[:upper:]' '[:lower:]'`
echo "bucket_prefix=${bucket_prefix}" >> $GITHUB_OUTPUT
- name: Run Case
run: |
echo "FE: ${FE_NODE}, BE: ${BE_NODE}"
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
cd ${{ github.workspace }}
rm -rf ./StarRocksTest && cp -rf /var/lib/StarRocksTest ./StarRocksTest && cd ./StarRocksTest && git pull
cd ${{ github.workspace }}/ci-tool
cluster_type=native
./bin/run-admit-single.sh --pr ${PR_NUMBER} --branch ${BRANCH} --repository ${{ github.repository }} --cluster ${cluster_type}
- name: Prepare Tools
if: success() || failure()
id: prepare-tools
run: |
mkdir -p .actions/nose-report-action
cd .actions/nose-report-action
git clone https://github.com/StarRocks/action-junit-report.git .
- name: Publish Admit Report
uses: ./.actions/nose-report-action
if: always() && steps.prepare-tools.outcome == 'success'
with:
check_name: Admit Report (${{ env.BUILD_TYPE }} ${{ env.LINUX_DISTRO }})
fail_on_failure: true
detailed_summary: true
token: ${{ secrets.GITHUB_TOKEN }}
report_paths: './StarRocksTest/result/*.xml'
- name: Clean ENV
if: always()
run: |
rm -rf ${{ github.workspace }}/*