forked from dm-vdo/vdo-devel
-
Notifications
You must be signed in to change notification settings - Fork 0
236 lines (204 loc) · 7.11 KB
/
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
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
name: CI
on:
pull_request_target:
types: [ opened, reopened, ready_for_review, synchronize ]
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
env:
LOGFILE: logs-${{ github.event.repository.owner.login }}-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
jobs:
Starting:
runs-on: ubuntu-latest
steps:
- name: Display CI Info
run: |
echo CI starting for the following:
echo org: ${{ github.event.repository.owner.login }}
echo repo: ${{ github.event.repository.name }}
echo pr: ${{ github.event.pull_request.number }}:
echo commit: ${{ github.event.pull_request.head.sha }}
echo action: ${{ github.event.action }}
# Run assignment action
- name: Assign reviewers and assignees
uses: dm-vdo/vdo-auto-assign@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Remove all known labels
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
labels: verification needed, untested, public testing running, public testing done, public testing failed, private testing running, private testing done, private testing failed
type: remove
Verifying:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Start verification
run: echo Verification Start
- name: Check for org membership
id: is_organization_member
uses: jamessingleton/[email protected]
with:
organization: dm-vdo
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Add untested label
if: ${{ steps.is_organization_member.outputs.result == 'true' }}
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: untested
type: add
- name: Add verification needed
if: ${{ steps.is_organization_member.outputs.result == 'false' }}
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: verification needed
type: add
- name: Wait for verification
if: ${{ steps.is_organization_member.outputs.result == 'false' }}
uses: trstringer/manual-approval@v1
timeout-minutes: 1440
with:
secret: ${{ secrets.VDODEVEL }}
approvers: bjohnsto, c2redhat, lorelei-sakai, raeburn, rhawalsh
minimum-approvals: 1
issue-title: "Verifying pull request for testing"
issue-body: "Please approve or deny the testing of this pull request."
exclude-workflow-initiator-as-approver: false
- name: Remove verification needed label
if: ${{ steps.is_organization_member.outputs.result == 'false' }}
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: verification needed
type: remove
Public-Testing:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, untrusted]
needs: [Verifying]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Start testing
run: echo Testing Start
- name: Add testing running label
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: public testing running
type: add
- name: Remove untested label
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: untested
type: remove
- name: Run-Untrusted-Tests
run: |
make oss-jenkins
- name: Remove public testing running label
if: always()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: public testing running
type: remove
- name: Add public testing failed
if: failure()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: public testing failed
type: add
- name: Upload test results
if: failure()
uses: EnricoMi/publish-unit-test-result-action/composite@v1
with:
files: logs/**/*.xml
- name: Prepare logfiles
if: failure()
run: |
cd logs
for i in *;
do
if [ -d "$i" ]; then
cd $i
for file in *::*.log;
do
[ -e "$file" ] || continue
mv "${file}" "${file/::/--}"
done
cd ..
else
mv "${i}" "${i/::/--}"
fi
done
- name: Upload logfiles
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ env.LOGFILE }}
path: logs/*/*.log
retention-days: 5
- name: Add public testing success
if: success()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: public testing done
type: add
Private-Testing:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, trusted]
needs: [Verifying, Public-Testing]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Start Private testing
run: echo Private Testing Start
- name: Add public testing success
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: public testing done
type: remove
- name: Add testing running label
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing running
type: add
- name: Run-trusted-Tests
run: make jenkins
- name: Copy log file to /permatbit/user/bunsen/artifacts
if: failure()
run: |
cp -a logs /permabit/user/bunsen/artifacts/${{ env.LOGFILE }}
- name: Remove private testing running label
if: always()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing running
type: remove
- name: Add private testing failed
if: failure()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing failed
type: add
- name: Add private testing success
if: success()
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: private testing done
type: add