@@ -2,6 +2,11 @@ name: Build x86 Image
2
2
3
3
on :
4
4
pull_request :
5
+ types :
6
+ - opened
7
+ - synchronize
8
+ - reopened
9
+ - labeled
5
10
branches :
6
11
- master
7
12
- release-*
@@ -21,9 +26,7 @@ concurrency:
21
26
cancel-in-progress : true
22
27
23
28
env :
24
- GO_VERSION : ' 1.19'
25
- GOSEC_VERSION : ' 2.12.0'
26
- KIND_VERSION : v0.17.0
29
+ GOSEC_VERSION : ' 2.14.0'
27
30
HELM_VERSION : v3.10.1
28
31
29
32
jobs :
35
38
- uses : docker/setup-buildx-action@v2
36
39
- uses : actions/setup-go@v3
37
40
with :
38
- go-version : ' ${{ env.GO_VERSION }} '
41
+ go-version-file : go.mod
39
42
check-latest : true
40
- id : go
41
43
42
44
- name : Export Go full version
43
45
run : echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"
@@ -134,9 +136,8 @@ jobs:
134
136
135
137
- uses : actions/setup-go@v3
136
138
with :
137
- go-version : ' ${{ env.GO_VERSION }}'
139
+ go-version-file : ${{ env.E2E_DIR }}/go.mod
138
140
check-latest : true
139
- id : go
140
141
141
142
- name : Export Go full version
142
143
run : echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"
@@ -155,10 +156,9 @@ jobs:
155
156
run : make e2e-compile
156
157
157
158
- name : Install kind
158
- run : |
159
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
160
- chmod +x ./kind
161
- sudo mv kind /usr/local/bin
159
+ uses : helm/kind-action@v1
160
+ with :
161
+ install_only : true
162
162
163
163
- name : Download image
164
164
uses : actions/download-artifact@v3
@@ -189,6 +189,7 @@ jobs:
189
189
190
190
k8s-netpol-e2e :
191
191
name : Kubernetes Network Policy E2E
192
+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
192
193
needs : build-kube-ovn
193
194
runs-on : ubuntu-22.04
194
195
timeout-minutes : 60
@@ -227,9 +228,8 @@ jobs:
227
228
228
229
- uses : actions/setup-go@v3
229
230
with :
230
- go-version : ' ${{ env.GO_VERSION }}'
231
+ go-version-file : ${{ env.E2E_DIR }}/go.mod
231
232
check-latest : true
232
- id : go
233
233
234
234
- name : Export Go full version
235
235
run : echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"
@@ -248,10 +248,9 @@ jobs:
248
248
run : make e2e-compile
249
249
250
250
- name : Install kind
251
- run : |
252
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
253
- chmod +x ./kind
254
- sudo mv kind /usr/local/bin
251
+ uses : helm/kind-action@v1
252
+ with :
253
+ install_only : true
255
254
256
255
- name : Download image
257
256
uses : actions/download-artifact@v3
@@ -278,6 +277,7 @@ jobs:
278
277
279
278
cyclonus-netpol-e2e :
280
279
name : Cyclonus Network Policy E2E
280
+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
281
281
needs : build-kube-ovn
282
282
runs-on : ubuntu-22.04
283
283
timeout-minutes : 30
@@ -310,10 +310,10 @@ jobs:
310
310
fi
311
311
312
312
- name : Install kind
313
- run : |
314
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
315
- chmod +x ./kind
316
- sudo mv kind /usr/local/bin
313
+ uses : helm/kind-action@v1
314
+ with :
315
+ install_only : true
316
+
317
317
- name : Download image
318
318
uses : actions/download-artifact@v3
319
319
with :
@@ -349,9 +349,6 @@ jobs:
349
349
- ipv4
350
350
- ipv6
351
351
- dual
352
- mode :
353
- - overlay
354
- - underlay
355
352
steps :
356
353
- uses : actions/checkout@v3
357
354
@@ -375,9 +372,8 @@ jobs:
375
372
376
373
- uses : actions/setup-go@v3
377
374
with :
378
- go-version : ' ${{ env.GO_VERSION }}'
375
+ go-version-file : ${{ env.E2E_DIR }}/go.mod
379
376
check-latest : true
380
- id : go
381
377
382
378
- name : Export Go full version
383
379
run : echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"
@@ -396,10 +392,9 @@ jobs:
396
392
run : make e2e-compile
397
393
398
394
- name : Install kind
399
- run : |
400
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
401
- chmod +x ./kind
402
- sudo mv kind /usr/local/bin
395
+ uses : helm/kind-action@v1
396
+ with :
397
+ install_only : true
403
398
404
399
- name : Download image
405
400
uses : actions/download-artifact@v3
@@ -418,14 +413,13 @@ jobs:
418
413
sudo chown -R $(id -un). ~/.kube/
419
414
420
415
- name : Install Kube-OVN
421
- run : make kind-install-${{ matrix.mode }}-${{ matrix. ip-family }}
416
+ run : make kind-install-${{ matrix.ip-family }}
422
417
423
418
- name : Run E2E
424
419
working-directory : ${{ env.E2E_DIR }}
425
420
env :
426
421
E2E_BRANCH : ${{ github.base_ref || github.ref_name }}
427
422
E2E_IP_FAMILY : ${{ matrix.ip-family }}
428
- E2E_NETWORK_MODE : ${{ matrix.mode }}
429
423
run : make kube-ovn-conformance-e2e
430
424
431
425
- name : Cleanup
@@ -440,10 +434,9 @@ jobs:
440
434
- uses : actions/checkout@v3
441
435
442
436
- name : Install kind
443
- run : |
444
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
445
- chmod +x ./kind
446
- sudo mv kind /usr/local/bin
437
+ uses : helm/kind-action@v1
438
+ with :
439
+ install_only : true
447
440
448
441
- name : Download image
449
442
uses : actions/download-artifact@v3
@@ -476,10 +469,9 @@ jobs:
476
469
- uses : actions/checkout@v3
477
470
478
471
- name : Install kind
479
- run : |
480
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
481
- chmod +x ./kind
482
- sudo mv kind /usr/local/bin
472
+ uses : helm/kind-action@v1
473
+ with :
474
+ install_only : true
483
475
484
476
- name : Download image
485
477
uses : actions/download-artifact@v3
@@ -514,10 +506,9 @@ jobs:
514
506
- uses : actions/checkout@v3
515
507
516
508
- name : Install kind
517
- run : |
518
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
519
- chmod +x ./kind
520
- sudo mv kind /usr/local/bin
509
+ uses : helm/kind-action@v1
510
+ with :
511
+ install_only : true
521
512
522
513
- name : Download image
523
514
uses : actions/download-artifact@v3
@@ -552,10 +543,9 @@ jobs:
552
543
- uses : actions/checkout@v3
553
544
554
545
- name : Install kind
555
- run : |
556
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
557
- chmod +x ./kind
558
- sudo mv kind /usr/local/bin
546
+ uses : helm/kind-action@v1
547
+ with :
548
+ install_only : true
559
549
560
550
- name : Download image
561
551
uses : actions/download-artifact@v3
@@ -615,9 +605,8 @@ jobs:
615
605
616
606
- uses : actions/setup-go@v3
617
607
with :
618
- go-version : ' ${{ env.GO_VERSION }}'
608
+ go-version-file : ${{ env.E2E_DIR }}/go.mod
619
609
check-latest : true
620
- id : go
621
610
622
611
- name : Export Go full version
623
612
run : echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"
@@ -636,10 +625,9 @@ jobs:
636
625
run : make e2e-compile
637
626
638
627
- name : Install kind
639
- run : |
640
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
641
- chmod +x ./kind
642
- sudo mv kind /usr/local/bin
628
+ uses : helm/kind-action@v1
629
+ with :
630
+ install_only : true
643
631
644
632
- name : Download image
645
633
uses : actions/download-artifact@v3
@@ -679,6 +667,7 @@ jobs:
679
667
- no-np-test
680
668
- cilium-chaining-e2e
681
669
name : push
670
+ if : always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
682
671
runs-on : ubuntu-22.04
683
672
steps :
684
673
- uses : actions/checkout@v3
@@ -708,7 +697,7 @@ jobs:
708
697
make scan
709
698
710
699
- name : Push
711
- if : ${{ github.ref == 'refs/heads/master' || contains (github.ref , 'release') }}
700
+ if : github.ref_name == github.event.repository.default_branch || startsWith (github.ref_name , 'release-')
712
701
env :
713
702
DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
714
703
DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
0 commit comments