@@ -144,6 +144,39 @@ jobs:
144
144
- run : make e2e-build
145
145
working-directory : ${{ env.E2E_DIR }}
146
146
147
+ netpol-path-filter :
148
+ name : Network Policy Path Filter
149
+ if : github.event_name != 'pull_request'
150
+ runs-on : ubuntu-22.04
151
+ outputs :
152
+ test-netpol : ${{ steps.filter.outputs.kube-ovn-controller }}
153
+ steps :
154
+ - uses : actions/checkout@v3
155
+ - uses : actions/setup-go@v3
156
+ with :
157
+ go-version-file : go.mod
158
+ check-latest : true
159
+
160
+ - name : Generate path filter
161
+ run : |
162
+ filter=".github/path-filters.yaml"
163
+ cat > $filter <<EOF
164
+ kube-ovn-controller:
165
+ - go.mod
166
+ - go.sum
167
+ EOF
168
+
169
+ sh hack/go-list.sh pkg/controller | while read f; do
170
+ echo "- $f" | tee -a $filter
171
+ done
172
+
173
+ - uses : dorny/paths-filter@v2
174
+ id : filter
175
+ with :
176
+ base : ${{ github.base_ref || github.ref_name }}
177
+ filters : .github/path-filters.yaml
178
+ list-files : csv
179
+
147
180
k8s-conformance-e2e :
148
181
name : Kubernetes Conformance E2E
149
182
needs :
@@ -244,10 +277,13 @@ jobs:
244
277
245
278
k8s-netpol-e2e :
246
279
name : Kubernetes Network Policy E2E
247
- if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
280
+ if : |
281
+ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') &&
282
+ (needs.netpol-path-filter.outputs.test-netpol == 1 || contains(github.event.pull_request.labels.*.name, 'network policy'))
248
283
needs :
249
284
- build-kube-ovn
250
285
- build-e2e-binaries
286
+ - netpol-path-filter
251
287
runs-on : ubuntu-22.04
252
288
timeout-minutes : 60
253
289
strategy :
@@ -336,8 +372,12 @@ jobs:
336
372
337
373
cyclonus-netpol-e2e :
338
374
name : Cyclonus Network Policy E2E
339
- if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
340
- needs : build-kube-ovn
375
+ if : |
376
+ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') &&
377
+ (needs.netpol-path-filter.outputs.test-netpol == 1 || contains(github.event.pull_request.labels.*.name, 'network policy'))
378
+ needs :
379
+ - build-kube-ovn
380
+ - netpol-path-filter
341
381
runs-on : ubuntu-22.04
342
382
timeout-minutes : 30
343
383
strategy :
0 commit comments