1
- name : Continuous Integration
1
+ name : CI
2
2
3
3
on :
4
4
push :
@@ -45,33 +45,26 @@ jobs:
45
45
name : Checks and variables
46
46
runs-on : ubuntu-20.04
47
47
outputs :
48
- go_version : ${{ steps.vars.outputs.go_version }}
49
48
go_path : ${{ steps.go.outputs.go_path }}
50
49
k8s_latest : ${{ steps.vars.outputs.k8s_latest }}
51
50
steps :
52
51
- name : Checkout Repository
53
52
uses : actions/checkout@v3
54
- - name : Cache Go controller tools
55
- uses : actions/cache@v3
56
- with :
57
- path : |
58
- ~/.cache/go-build
59
- ~/go/pkg/mod
60
- key : ${{ runner.os }}-go-tools-${{ hashFiles('**/go.sum') }}
61
- restore-keys : |
62
- ${{ runner.os }}-go-tools-
63
53
- name : Output Variables
64
54
id : vars
65
55
run : |
66
- echo "::set-output name=go_version::$(grep "go 1." go.mod | cut -d " " -f 2)"
67
56
echo "::set-output name=k8s_latest::$(grep -m1 'FROM kindest/node' <tests/docker/Dockerfile | awk -F'[:v]' '{print $3}')"
68
57
- name : Setup Golang Environment
69
58
uses : actions/setup-go@v3
70
59
with :
71
- go-version : ${{ steps.vars.outputs.go_version }}
60
+ go-version-file : go.mod
61
+ cache : true
72
62
- name : Determine GOPATH
73
63
id : go
74
64
run : echo "::set-output name=go_path::$(go env GOPATH)"
65
+ - name : Check if go.mod and go.sum are up to date
66
+ run : |
67
+ go mod tidy && git diff --exit-code -- go.mod go.sum
75
68
- name : Check if CRDs changed
76
69
run : |
77
70
make update-crds && git diff --name-only --exit-code deployments/common/crds* deployments/helm-chart/crds*
@@ -90,19 +83,11 @@ jobs:
90
83
uses : actions/checkout@v3
91
84
with :
92
85
fetch-depth : 0
93
- - name : Cache Go build
94
- uses : actions/cache@v3
95
- with :
96
- path : |
97
- ~/.cache/go-build
98
- ~/go/pkg/mod
99
- key : ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
100
- restore-keys : |
101
- ${{ runner.os }}-go-build-
102
86
- name : Setup Golang Environment
103
87
uses : actions/setup-go@v3
104
88
with :
105
- go-version : ${{ needs.checks.outputs.go_version }}
89
+ go-version-file : go.mod
90
+ cache : true
106
91
- name : Build binary
107
92
uses : goreleaser/goreleaser-action@v3
108
93
with :
@@ -126,19 +111,11 @@ jobs:
126
111
steps :
127
112
- name : Checkout Repository
128
113
uses : actions/checkout@v3
129
- - name : Cache Go tests
130
- uses : actions/cache@v3
131
- with :
132
- path : |
133
- ~/.cache/go-build
134
- ~/go/pkg/mod
135
- key : ${{ runner.os }}-go-tests-${{ hashFiles('**/go.sum') }}
136
- restore-keys : |
137
- ${{ runner.os }}-go-tests-
138
114
- name : Setup Golang Environment
139
115
uses : actions/setup-go@v3
140
116
with :
141
- go-version : ${{ needs.checks.outputs.go_version }}
117
+ go-version-file : go.mod
118
+ cache : true
142
119
- name : Run Tests
143
120
run : make cover
144
121
- name : Upload coverage to Codecov
@@ -166,10 +143,11 @@ jobs:
166
143
{\"image\": \"debian-plus\", \"marker\": \"ts\"}, \
167
144
{\"image\": \"alpine-plus\", \"marker\":\"ingresses\"}, \
168
145
{\"image\": \"alpine-plus\", \"marker\": \"vsr\"}, \
169
- {\"image\": \"ubi-plus\", \"marker\": \"policies\"}], \
146
+ {\"image\": \"ubi-plus\", \"marker\": \"policies\"}, \
147
+ {\"image\": \"debian-plus-nap\", \"marker\": \"dos\"}], \
170
148
\"k8s\": [\"${{ needs.checks.outputs.k8s_latest }}\"]}"
171
149
else
172
- echo "::set-output name=matrix::{\"k8s\": [\"1.19.16\", \"1.20.15\", \"1.21.10 \", \"1.22.7 \", \"${{ needs.checks.outputs.k8s_latest }}\"], \
150
+ echo "::set-output name=matrix::{\"k8s\": [\"1.19.16\", \"1.20.15\", \"1.21.14 \", \"1.22.13\", \"1.23.10\", \"1.24.4 \", \"${{ needs.checks.outputs.k8s_latest }}\"], \
173
151
\"images\": [{\"image\": \"debian\"}, {\"image\": \"debian-plus\"}]}"
174
152
fi
175
153
@@ -190,8 +168,8 @@ jobs:
190
168
image : ${{ matrix.images.image != '' && matrix.images.image || 'debian' }}
191
169
marker : ${{ matrix.images.marker != '' && matrix.images.marker || '' }}
192
170
k8s-version : ${{ matrix.k8s }}
193
- nginx-crt : ${{ secrets.NGINX_CRT }}
194
- nginx-key : ${{ secrets.NGINX_KEY }}
171
+ nginx-crt : ${{ contains(matrix.images.image, 'nap') && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}
172
+ nginx-key : ${{ contains(matrix.images.image, 'nap') && secrets.NGINX_AP_KEY || secrets.NGINX_KEY }}
195
173
- name : Upload Test Results
196
174
uses : actions/upload-artifact@v3
197
175
with :
@@ -266,19 +244,11 @@ jobs:
266
244
uses : actions/checkout@v3
267
245
with :
268
246
fetch-depth : 0
269
- - name : Cache Go build
270
- uses : actions/cache@v3
271
- with :
272
- path : |
273
- ~/.cache/go-build
274
- ~/go/pkg/mod
275
- key : ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
276
- restore-keys : |
277
- ${{ runner.os }}-go-build-
278
247
- name : Setup Golang Environment
279
248
uses : actions/setup-go@v3
280
249
with :
281
- go-version : ${{ needs.checks.outputs.go_version }}
250
+ go-version-file : go.mod
251
+ cache : true
282
252
283
253
- uses : actions/setup-node@v3
284
254
- run : npm install js-yaml
@@ -324,7 +294,7 @@ jobs:
324
294
if : startsWith(github.ref, 'refs/tags/')
325
295
326
296
- name : Download Syft
327
- uses : anchore/sbom-action/download-syft@v0.11 .0
297
+ uses : anchore/sbom-action/download-syft@v0.12 .0
328
298
329
299
- name : Build binaries
330
300
uses : goreleaser/goreleaser-action@v3
@@ -457,7 +427,7 @@ jobs:
457
427
BUILD_OS=${{ matrix.image }}
458
428
IC_VERSION=${{ steps.var.outputs.ic_version }}
459
429
- name : Run Trivy vulnerability scanner
460
- uses : aquasecurity/trivy-action@0.5 .1
430
+ uses : aquasecurity/trivy-action@0.7 .1
461
431
continue-on-error : true
462
432
with :
463
433
image-ref : nginx/nginx-ingress:${{ steps.meta.outputs.version }}
@@ -494,6 +464,10 @@ jobs:
494
464
- image : debian-plus
495
465
platforms : " linux/arm64, linux/amd64"
496
466
target : aws
467
+ - image : debian-plus-nap
468
+ platforms : " linux/amd64"
469
+ target : goreleaser
470
+
497
471
steps :
498
472
- name : Checkout Repository
499
473
uses : actions/checkout@v3
@@ -531,9 +505,9 @@ jobs:
531
505
uses : docker/metadata-action@v4
532
506
with :
533
507
images : |
534
- name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
535
- name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic/nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/tags/') }}
536
- name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/staging/nginx-ic/nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
508
+ name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic${{ contains(matrix.image, 'nap') && '-dos' || '' }} /nginx-plus-ingress
509
+ name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic${{ contains(matrix.image, 'nap') && '-dos' || '' }} /nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/tags/') }}
510
+ name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/staging/nginx-ic${{ contains(matrix.image, 'nap') && '-dos' || '' }} /nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
537
511
name=709825985650.dkr.ecr.us-east-1.amazonaws.com/nginx/nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/tags/') && contains(matrix.target, 'aws') }}
538
512
flavor : suffix=${{ contains(matrix.image, 'ubi') && '-ubi' || '' }}${{ contains(matrix.image, 'alpine') && '-alpine' || '' }}${{ contains(matrix.target, 'aws') && '-mktpl' || '' }},onlatest=true
539
513
tags : |
@@ -577,9 +551,10 @@ jobs:
577
551
build-args : |
578
552
BUILD_OS=${{ matrix.image }}
579
553
IC_VERSION=${{ startsWith(github.ref, 'refs/tags/') && steps.var.outputs.ic_version || 'CI' }}
554
+ ${{ contains(matrix.image, 'nap') && 'NAP_MODULES=dos' || '' }}
580
555
secrets : |
581
- "nginx-repo.crt=${{ secrets.NGINX_CRT }}"
582
- "nginx-repo.key=${{ secrets.NGINX_KEY }}"
556
+ "nginx-repo.crt=${{ contains(matrix.image, 'nap') && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}"
557
+ "nginx-repo.key=${{ contains(matrix.image, 'nap') && secrets.NGINX_AP_KEY || secrets.NGINX_KEY }}"
583
558
- name : Load image for Trivy
584
559
uses : docker/build-push-action@v3
585
560
with :
@@ -592,11 +567,12 @@ jobs:
592
567
build-args : |
593
568
BUILD_OS=${{ matrix.image }}
594
569
IC_VERSION=CI
570
+ ${{ contains(matrix.image, 'nap') && 'NAP_MODULES=dos' || '' }}
595
571
secrets : |
596
- "nginx-repo.crt=${{ secrets.NGINX_CRT }}"
597
- "nginx-repo.key=${{ secrets.NGINX_KEY }}"
572
+ "nginx-repo.crt=${{ contains(matrix.image, 'nap') && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}"
573
+ "nginx-repo.key=${{ contains(matrix.image, 'nap') && secrets.NGINX_AP_KEY || secrets.NGINX_KEY }}"
598
574
- name : Run Trivy vulnerability scanner
599
- uses : aquasecurity/trivy-action@0.5 .1
575
+ uses : aquasecurity/trivy-action@0.7 .1
600
576
continue-on-error : true
601
577
with :
602
578
image-ref : docker.io/${{ matrix.image }}:${{ steps.meta.outputs.version }}
0 commit comments