42
42
PROFILE : debug
43
43
44
44
jobs :
45
+ validate :
46
+ name : Validate comment
47
+ runs-on : ubuntu-latest
48
+ if : |
49
+ github.event_name != 'issue_comment' ||
50
+ ( github.event.issue.pull_request &&
51
+ ( contains(github.event.comment.body, '/ci-run-all') ||
52
+ contains(github.event.comment.body, '/ci-run-k8s')
53
+ )
54
+ )
55
+ steps :
56
+ - name : Get PR comment author
57
+ id : comment
58
+ uses : tspascoal/get-user-teams-membership@v2
59
+ with :
60
+ username : ${{ github.actor }}
61
+ team : ' Vector'
62
+ GITHUB_TOKEN : ${{ secrets.GH_PAT_ORG }}
63
+
64
+ - name : Validate author membership
65
+ if : steps.comment.outputs.isTeamMember == 'false'
66
+ run : exit 1
67
+
45
68
changes :
46
- if : github.event_name != 'issue_comment' || (github.event.issue.pull_request &&
47
- (contains(github.event.comment.body, '/ci-run-k8s') || contains(github.event.comment.body, '/ci-run-all')))
69
+ needs : validate
48
70
uses : ./.github/workflows/changes.yml
49
71
with :
50
72
base_ref : ${{ github.event.pull_request.base.ref }}
@@ -54,22 +76,14 @@ jobs:
54
76
build-x86_64-unknown-linux-gnu :
55
77
name : Build - x86_64-unknown-linux-gnu
56
78
runs-on : [linux, ubuntu-20.04-4core]
57
- needs : changes
79
+ needs : [ changes, validate]
58
80
if : github.event_name != 'pull_request' || needs.changes.outputs.k8s == 'true'
59
81
# cargo-deb requires a release build, but we don't need optimizations for tests
60
82
env :
61
83
CARGO_PROFILE_RELEASE_OPT_LEVEL : 0
62
84
CARGO_PROFILE_RELEASE_CODEGEN_UNITS : 256
63
85
CARGO_INCREMENTAL : 0
64
86
steps :
65
- - name : Validate issue comment
66
- if : github.event_name == 'issue_comment'
67
- uses : tspascoal/get-user-teams-membership@v2
68
- with :
69
- username : ${{ github.actor }}
70
- team : ' Vector'
71
- GITHUB_TOKEN : ${{ secrets.GH_PAT_ORG }}
72
-
73
87
- name : (PR comment) Get PR branch
74
88
if : ${{ github.event_name == 'issue_comment' }}
75
89
uses : xt0rted/pull-request-comment-branch@v2
@@ -127,19 +141,11 @@ jobs:
127
141
compute-k8s-test-plan :
128
142
name : Compute K8s test plan
129
143
runs-on : ubuntu-latest
130
- needs : changes
144
+ needs : [ changes, validate]
131
145
if : github.event_name != 'pull_request' || needs.changes.outputs.k8s == 'true'
132
146
outputs :
133
147
matrix : ${{ steps.set-matrix.outputs.matrix }}
134
148
steps :
135
- - name : Validate issue comment
136
- if : github.event_name == 'issue_comment'
137
- uses : tspascoal/get-user-teams-membership@v2
138
- with :
139
- username : ${{ github.actor }}
140
- team : ' Vector'
141
- GITHUB_TOKEN : ${{ secrets.GH_PAT_ORG }}
142
-
143
149
144
150
id : set-matrix
145
151
with :
@@ -189,6 +195,7 @@ jobs:
189
195
name : K8s ${{ matrix.kubernetes_version.version }} / ${{ matrix.container_runtime }} (${{ matrix.kubernetes_version.role }})
190
196
runs-on : [linux, ubuntu-20.04-4core]
191
197
needs :
198
+ - validate
192
199
- build-x86_64-unknown-linux-gnu
193
200
- compute-k8s-test-plan
194
201
strategy :
@@ -239,21 +246,13 @@ jobs:
239
246
final-result :
240
247
name : K8s E2E Suite
241
248
runs-on : ubuntu-latest
242
- needs : test-e2e-kubernetes
249
+ needs : [ test-e2e-kubernetes, validate]
243
250
if : |
244
251
always() && (github.event_name != 'issue_comment' || (github.event.issue.pull_request
245
252
&& (contains(github.event.comment.body, '/ci-run-k8s') || contains(github.event.comment.body, '/ci-run-all'))))
246
253
env :
247
254
FAILED : ${{ contains(needs.*.result, 'failure') }}
248
255
steps :
249
- - name : Validate issue comment
250
- if : github.event_name == 'issue_comment'
251
- uses : tspascoal/get-user-teams-membership@v2
252
- with :
253
- username : ${{ github.actor }}
254
- team : ' Vector'
255
- GITHUB_TOKEN : ${{ secrets.GH_PAT_ORG }}
256
-
257
256
- name : (PR comment) Get PR branch
258
257
if : success() && github.event_name == 'issue_comment'
259
258
uses : xt0rted/pull-request-comment-branch@v2
0 commit comments