@@ -169,6 +169,39 @@ jobs:
169
169
- run : make e2e-build
170
170
working-directory : ${{ env.E2E_DIR }}
171
171
172
+ netpol-path-filter :
173
+ name : Network Policy Path Filter
174
+ if : github.event_name != 'pull_request'
175
+ runs-on : ubuntu-22.04
176
+ outputs :
177
+ test-netpol : ${{ steps.filter.outputs.kube-ovn-controller }}
178
+ steps :
179
+ - uses : actions/checkout@v3
180
+ - uses : actions/setup-go@v3
181
+ with :
182
+ go-version-file : go.mod
183
+ check-latest : true
184
+
185
+ - name : Generate path filter
186
+ run : |
187
+ filter=".github/path-filters.yaml"
188
+ cat > $filter <<EOF
189
+ kube-ovn-controller:
190
+ - go.mod
191
+ - go.sum
192
+ EOF
193
+
194
+ sh hack/go-list.sh pkg/controller | while read f; do
195
+ echo "- $f" | tee -a $filter
196
+ done
197
+
198
+ - uses : dorny/paths-filter@v2
199
+ id : filter
200
+ with :
201
+ base : ${{ github.base_ref || github.ref_name }}
202
+ filters : .github/path-filters.yaml
203
+ list-files : csv
204
+
172
205
k8s-conformance-e2e :
173
206
name : Kubernetes Conformance E2E
174
207
needs :
@@ -269,10 +302,13 @@ jobs:
269
302
270
303
k8s-netpol-e2e :
271
304
name : Kubernetes Network Policy E2E
272
- if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
305
+ if : |
306
+ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') &&
307
+ (needs.netpol-path-filter.outputs.test-netpol == 1 || contains(github.event.pull_request.labels.*.name, 'network policy'))
273
308
needs :
274
309
- build-kube-ovn
275
310
- build-e2e-binaries
311
+ - netpol-path-filter
276
312
runs-on : ubuntu-22.04
277
313
timeout-minutes : 60
278
314
strategy :
@@ -361,10 +397,13 @@ jobs:
361
397
362
398
k8s-netpol-legacy-e2e :
363
399
name : Kubernetes Network Policy Legacy E2E
364
- if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
400
+ if : |
401
+ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') &&
402
+ (needs.netpol-path-filter.outputs.test-netpol == 1 || contains(github.event.pull_request.labels.*.name, 'network policy'))
365
403
needs :
366
404
- build-kube-ovn
367
405
- build-e2e-binaries
406
+ - netpol-path-filter
368
407
runs-on : ubuntu-22.04
369
408
timeout-minutes : 60
370
409
strategy :
@@ -453,8 +492,12 @@ jobs:
453
492
454
493
cyclonus-netpol-e2e :
455
494
name : Cyclonus Network Policy E2E
456
- if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
457
- needs : build-kube-ovn
495
+ if : |
496
+ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') &&
497
+ (needs.netpol-path-filter.outputs.test-netpol == 1 || contains(github.event.pull_request.labels.*.name, 'network policy'))
498
+ needs :
499
+ - build-kube-ovn
500
+ - netpol-path-filter
458
501
runs-on : ubuntu-22.04
459
502
timeout-minutes : 30
460
503
strategy :
0 commit comments