14
14
description : " Force rebuild"
15
15
required : false
16
16
default : false
17
+ run_tests :
18
+ type : boolean
19
+ description : " Run unit & e2e tests"
20
+ required : false
21
+ default : true
17
22
18
23
defaults :
19
24
run :
35
40
id-token : write
36
41
outputs :
37
42
docs_only : ${{ github.event.pull_request && steps.docs.outputs.docs_only == 'true' }}
38
- k8s_latest : " 1.32.0 "
43
+ k8s_latest : ${{ steps.vars.outputs.k8s_latest }}
39
44
go_path : ${{ steps.vars.outputs.go_path }}
40
45
go_code_md5 : ${{ steps.vars.outputs.go_code_md5 }}
41
46
binary_cache_hit : ${{ steps.binary-cache.outputs.cache-hit }}
@@ -215,25 +220,25 @@ jobs:
215
220
uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
216
221
with :
217
222
go-version-file : go.mod
218
- if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
223
+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
219
224
220
225
- name : Run Tests
221
226
run : make cover
222
- if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
227
+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
223
228
224
229
- name : Upload coverage to Codecov
225
230
uses : codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
226
231
with :
227
232
files : ./coverage.txt
228
233
token : ${{ secrets.CODECOV_TOKEN }} # required
229
- if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
234
+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
230
235
231
236
- name : Run static check
232
237
uses : dominikh/staticcheck-action@024238d2898c874f26d723e7d0ff4308c35589a2 # v1.4.0
233
238
with :
234
239
version : " v0.6.0"
235
240
install-go : false
236
- if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
241
+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
237
242
238
243
binaries :
239
244
name : Build Binaries
@@ -253,7 +258,7 @@ jobs:
253
258
uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
254
259
with :
255
260
go-version-file : go.mod
256
- if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
261
+ if : ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
257
262
258
263
- name : Build binaries
259
264
uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
@@ -272,14 +277,14 @@ jobs:
272
277
AWS_NAP_WAF_DOS_PRODUCT_CODE : ${{ secrets.AWS_NAP_WAF_DOS_PRODUCT_CODE }}
273
278
AWS_NAP_WAF_DOS_PUB_KEY : ${{ secrets.AWS_NAP_WAF_DOS_PUB_KEY }}
274
279
GORELEASER_CURRENT_TAG : " v${{ needs.checks.outputs.ic_version }}"
275
- if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
280
+ if : ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
276
281
277
282
- name : Store Artifacts in Cache
278
283
uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
279
284
with :
280
285
path : ${{ github.workspace }}/dist
281
286
key : nginx-ingress-${{ needs.checks.outputs.go_code_md5 }}
282
- if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
287
+ if : ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
283
288
284
289
build-docker :
285
290
name : Build Docker OSS
@@ -373,7 +378,7 @@ jobs:
373
378
if : ${{ inputs.force || (needs.checks.outputs.forked_workflow == 'true' && needs.checks.outputs.docs_only == 'false') || (needs.checks.outputs.forked_workflow == 'false' && needs.checks.outputs.stable_image_exists != 'true' && needs.checks.outputs.docs_only == 'false') }}
374
379
375
380
helm-tests :
376
- if : ${{ needs.checks.outputs.docs_only != 'true' }}
381
+ if : ${{ needs.checks.outputs.docs_only != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
377
382
name : Helm Tests ${{ matrix.base-os }}
378
383
runs-on : ubuntu-22.04
379
384
needs : [checks, binaries, build-docker, build-docker-plus]
@@ -512,7 +517,7 @@ jobs:
512
517
if : ${{ steps.stable_exists.outputs.exists != 'true' && needs.checks.outputs.docs_only == 'false' }}
513
518
514
519
setup-matrix :
515
- if : ${{ inputs.force || needs.checks.outputs.docs_only != 'true' }}
520
+ if : ${{ inputs.force || (inputs.run_tests && inputs.run_tests || true) || needs.checks.outputs.docs_only != 'true' }}
516
521
name : Setup Matrix for Smoke Tests
517
522
runs-on : ubuntu-22.04
518
523
needs : [binaries, checks]
@@ -574,7 +579,7 @@ jobs:
574
579
if : ${{ steps.check-image.outcome == 'failure' && needs.checks.outputs.docs_only == 'false' }}
575
580
576
581
smoke-tests-oss :
577
- if : ${{ inputs.force || needs.checks.outputs.docs_only != 'true' }}
582
+ if : ${{ inputs.force || (inputs.run_tests && inputs.run_tests || true) || needs.checks.outputs.docs_only != 'true' }}
578
583
name : ${{ matrix.images.label }} ${{ matrix.images.image }} ${{ matrix.k8s }} smoke tests
579
584
needs :
580
585
- checks
@@ -601,7 +606,7 @@ jobs:
601
606
k8s-version : ${{ matrix.k8s }}
602
607
603
608
smoke-tests-plus :
604
- if : ${{ inputs.force || needs.checks.outputs.docs_only != 'true' }}
609
+ if : ${{ inputs.force || (inputs.run_tests && inputs.run_tests || true) || needs.checks.outputs.docs_only != 'true' }}
605
610
name : ${{ matrix.images.label }} ${{ matrix.images.image }} ${{ matrix.k8s }} smoke tests
606
611
needs :
607
612
- checks
@@ -628,7 +633,7 @@ jobs:
628
633
k8s-version : ${{ matrix.k8s }}
629
634
630
635
smoke-tests-nap :
631
- if : ${{ inputs.force || needs.checks.outputs.docs_only != 'true' }}
636
+ if : ${{ inputs.force || (inputs.run_tests && inputs.run_tests || true) || needs.checks.outputs.docs_only != 'true' }}
632
637
name : ${{ matrix.images.label }} ${{ matrix.images.image }} ${{ matrix.k8s }} smoke tests
633
638
needs :
634
639
- checks
0 commit comments