-
Notifications
You must be signed in to change notification settings - Fork 2
209 lines (181 loc) · 6.28 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
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
jobs:
Verifying:
runs-on: ubuntu-latest
steps:
- name: Start verification
run: echo Verification Start
# 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
- 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.GITHUB_TOKEN }}
approvers: ${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }}
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:
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: |
sed -i 's/FEDORA37 FEDORA38 RHEL9/FEDORA36 FEDORA37/' src/perl/vdotest/vdotests.suites
make 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 artifact
if: failure()
uses: EnricoMi/publish-unit-test-result-action/composite@v1
with:
files: logs/**/*.xml
- name: Prepare Logfiles
if: failure()
run: |
cd logs/vdotests
for file in *::*.log;
do
mv ${file} ${file/::/--}
done
- name: Upload artifact
if: failure()
uses: actions/upload-artifact@v2
with:
name: Upload Test Logs
path: logs/vdotests/*.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:
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 /home/bunsen-home/artifacts
if: failure()
run: |
REPO=${{ github.repository }}
REPO=${REPO//\//-}
cp -a logs /home/bunsen-home/artifacts/logs.`date +'%Y%m%d%H%M'`.$REPO.${{ github.event.number }}
- 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