This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
650 lines (538 loc) · 22.6 KB
/
pr-checks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
name: PR checks
on:
pull_request:
branches:
- master
- 'release-v**.x'
env:
GO111MODULE: on
SDK_VERSION: "1.17.0"
MINIKUBE_WANTUPDATENOTIFICATION: false
MINIKUBE_WANTREPORTERRORPROMPT: false
K8S_VERSION: "1.21.3"
MINIKUBE_VERSION: "1.26.0"
OLM_VERSION: "0.22.0"
TEST_ACCEPTANCE_CLI: "kubectl"
TEST_RESULTS: "out/acceptance-tests"
jobs:
lint:
name: Code Quality
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "^1.18"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Checkout repo
uses: actions/checkout@v3
- name: Run linters
run: make lint
unit:
name: Unit Tests with Code coverage
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "^1.18"
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Unit Tests with Code Coverage
run: |
make test
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v3
with:
file: cover.out
verbose: true
fail_ci_if_error: true
acceptance:
name: Acceptance Tests with Kubernetes and using OLM
runs-on: ubuntu-20.04
timeout-minutes: 90
env:
EXTRA_BEHAVE_ARGS: "--tags=~@knative --tags=~@openshift --tags=~@examples --tags=~@supported-operator --tags=~@optional-annotations --tags=~@workload-resource-mapping --tags=~@upgrade-with-olm --tags=~@disable-github-actions"
TEST_RUN: Acceptance_tests_Kubernetes_with_OLM
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Check if acceptance tests can be skipped
id: check-skip-acceptance
uses: ./.github/actions/check-skip-acceptance-tests
- name: Set up Python
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Setup-cli
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: ./.github/actions/setup-cli
with:
start-minikube: true
- name: Wait for push
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
- name: Extract image references
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
- name: Acceptance tests
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 60
run: |
source ./operator.refs
export CATSRC_NAME=sbo-pr-checks
make SKIP_REGISTRY_LOGIN=true -o registry-login test-acceptance-with-bundle
- name: Collect Kube resources
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
continue-on-error: true
uses: ./.github/actions/collect-kube-resources
with:
operator-namespace: operators
olm-namespace: olm
test-namespace-file: out/test-namespace
output-path: ${{env.TEST_RESULTS}}
- name: Setup Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Publish tests results to Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
run: |
testspace [${{ env.TEST_RUN }}]${{ env.TEST_RESULTS }}/TEST*.xml
- uses: actions/upload-artifact@v3
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
with:
name: kubernetes-with-olm-test-results
path: ${{ env.TEST_RESULTS }}
acceptance-optional-annotations:
name: Optional Annotations Acceptance Tests with Kubernetes and using OLM
runs-on: ubuntu-20.04
env:
EXTRA_BEHAVE_ARGS: "--tags=@optional-annotations --tags=~@disable-github-actions"
TEST_RUN: Optional_Annotations_Acceptance_tests_Kubernetes_with_OLM
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Check if acceptance tests can be skipped
id: check-skip-acceptance
uses: ./.github/actions/check-skip-acceptance-tests
- name: Set up Python
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Setup-cli
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: ./.github/actions/setup-cli
with:
start-minikube: true
- name: Wait for push
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
- name: Extract image references
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
- name: Acceptance tests
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 60
run: |
source ./operator.refs
export CATSRC_NAME=sbo-pr-checks
make SKIP_REGISTRY_LOGIN=true -o registry-login test-acceptance-with-bundle
- name: Collect Kube resources
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
continue-on-error: true
uses: ./.github/actions/collect-kube-resources
with:
operator-namespace: operators
olm-namespace: olm
test-namespace-file: out/test-namespace
output-path: ${{env.TEST_RESULTS}}
- name: Setup Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Publish tests results to Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
run: |
testspace [${{ env.TEST_RUN }}]${{ env.TEST_RESULTS }}/TEST*.xml
- uses: actions/upload-artifact@v3
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
with:
name: optional-annotations
path: ${{ env.TEST_RESULTS }}
acceptance-supported-operators:
name: Supported Operators Acceptance Tests with Kubernetes and using OLM
runs-on: ubuntu-20.04
env:
EXTRA_BEHAVE_ARGS: "--tags=@supported-operator --tags=~@disable-github-actions"
TEST_RUN: Supported_Operators_Acceptance_tests_Kubernetes_with_OLM
DELETE_NAMESPACE: never
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Check if acceptance tests can be skipped
id: check-skip-acceptance
uses: ./.github/actions/check-skip-acceptance-tests
- name: Set up Python
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Setup-cli
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: ./.github/actions/setup-cli
with:
start-minikube: true
- name: Wait for push
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
- name: Extract image references
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
- name: Acceptance tests
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 60
run: |
source ./operator.refs
export CATSRC_NAME=sbo-pr-checks
make SKIP_REGISTRY_LOGIN=true -o registry-login test-acceptance-with-bundle
- name: Collect Kube resources
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
continue-on-error: true
uses: ./.github/actions/collect-kube-resources
with:
operator-namespace: operators
olm-namespace: olm
test-namespace-file: out/test-namespace
output-path: ${{env.TEST_RESULTS}}
- name: Setup Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Publish tests results to Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
run: |
testspace [${{ env.TEST_RUN }}]${{ env.TEST_RESULTS }}/TEST*.xml
- uses: actions/upload-artifact@v3
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
with:
name: supported-operators-kubernetes
path: ${{ env.TEST_RESULTS }}
acceptance-workload-resource-mapping:
name: Workload Resource Mapping Acceptance Tests with Kubernetes and using OLM
runs-on: ubuntu-20.04
env:
EXTRA_BEHAVE_ARGS: "--tags=@workload-resource-mapping --tags=~@disable-github-actions"
TEST_RUN: Workload_Resource_Mapping_Acceptance_tests_Kubernetes_with_OLM
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Check if acceptance tests can be skipped
id: check-skip-acceptance
uses: ./.github/actions/check-skip-acceptance-tests
- name: Set up Python
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Setup-cli
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: ./.github/actions/setup-cli
with:
start-minikube: true
- name: Wait for push
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
- name: Extract image references
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
- name: Acceptance tests
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 60
run: |
source ./operator.refs
export CATSRC_NAME=sbo-pr-checks
make SKIP_REGISTRY_LOGIN=true -o registry-login test-acceptance-with-bundle
- name: Collect Kube resources
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
continue-on-error: true
uses: ./.github/actions/collect-kube-resources
with:
operator-namespace: operators
olm-namespace: olm
test-namespace-file: out/test-namespace
output-path: ${{env.TEST_RESULTS}}
- name: Setup Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Publish tests results to Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
run: |
testspace [${{ env.TEST_RUN }}]${{ env.TEST_RESULTS }}/TEST*.xml
- uses: actions/upload-artifact@v3
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
with:
name: workload-resource-mapping
path: ${{ env.TEST_RESULTS }}
acceptance-upgrade-with-olm:
name: Acceptance Tests for upgrading SBO with OLM on Kubernetes
runs-on: ubuntu-20.04
env:
EXTRA_BEHAVE_ARGS: "--tags=@upgrade-with-olm --tags=~@disable-github-actions"
TEST_RUN: Acceptance_tests_Upgrade_with_OLM
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Check if acceptance tests can be skipped
id: check-skip-acceptance
uses: ./.github/actions/check-skip-acceptance-tests
- name: Set up Python
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Setup-cli
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: ./.github/actions/setup-cli
with:
start-minikube: true
- name: Install OLM
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 10
run: |
kubectl get crd clusterserviceversions.operators.coreos.com || curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v${OLM_VERSION}/install.sh | bash -s v${OLM_VERSION}
- name: Wait for push
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
- name: Extract image references
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
- name: Acceptance tests
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 60
run: |
source ./operator.refs
export PATH=$PATH:$(pwd)/bin
make opm yq
source ./hack/upgrade-sbo-env.sh
make SKIP_REGISTRY_LOGIN=true -o registry-login test-acceptance
- name: Collect Kube resources
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
continue-on-error: true
uses: ./.github/actions/collect-kube-resources
with:
operator-namespace: operators
olm-namespace: olm
test-namespace-file: out/test-namespace
output-path: ${{env.TEST_RESULTS}}
- name: Setup Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Publish tests results to Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
run: |
testspace [${{ env.TEST_RUN }}]${{ env.TEST_RESULTS }}/TEST*.xml
- uses: actions/upload-artifact@v3
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
with:
name: upgrade-with-olm
path: ${{ env.TEST_RESULTS }}
acceptance_without_olm:
name: Acceptance tests running on Kubernetes without using OLM
runs-on: ubuntu-20.04
timeout-minutes: 90
env:
EXTRA_BEHAVE_ARGS: "--tags=~@knative --tags=~@openshift --tags=~@olm --tags=~@disable-github-actions"
TEST_RUN: Acceptance_tests_Kubernetes_without_OLM
UMOCI_VERSION: "0.4.5"
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Check if acceptance tests can be skipped
id: check-skip-acceptance
uses: ./.github/actions/check-skip-acceptance-tests
- name: Set up Python
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Set up CLI
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: ./.github/actions/setup-cli
with:
start-minikube: true
- name: Set up Go
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-go@v4
with:
go-version: "^1.16"
- name: Setup umoci cli
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
run: |
curl -Lo umoci https://github.com/opencontainers/umoci/releases/download/v${UMOCI_VERSION}/umoci.amd64
chmod +x umoci
mv -v umoci $GITHUB_WORKSPACE/bin/
- name: Wait for push
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
- name: Extract image references
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
- name: Acceptance tests against vanilla k8s without OLM
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 60
run: |
source ./operator.refs
eval $(minikube docker-env)
make release-manifests deploy-cert-manager
kubectl apply -f out/release.yaml
kubectl rollout status -n service-binding-operator deploy/service-binding-operator -w --timeout=120s
make TEST_ACCEPTANCE_START_SBO=remote test-acceptance
- name: Collect Kube resources
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
continue-on-error: true
uses: ./.github/actions/collect-kube-resources
with:
operator-namespace: service-binding-operator
test-namespace-file: out/test-namespace
output-path: ${{env.TEST_RESULTS}}
- name: Setup Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Publish tests results to Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
run: |
testspace [${{ env.TEST_RUN }}]${{ env.TEST_RESULTS }}/TEST*.xml
- uses: actions/upload-artifact@v3
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
with:
name: kubernetes-without-olm-test-results
path: ${{ env.TEST_RESULTS }}
single-commit:
name: Single commit PR
runs-on: ubuntu-20.04
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Verify number of commits in the PR is 1
run: |
COMMIT_COUNT="$(git log --oneline ${{github.event.pull_request.base.sha}}..${{github.event.pull_request.head.sha}} | wc -l)"
if ! [ $COMMIT_COUNT -eq 1 ]; then
echo "Number of commits in the PR ($COMMIT_COUNT) must not be greater than one."
echo "Please squash all PR commits into a single one (https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_squashing)"
exit 1
fi
security-scan:
name: Security vulnerability scan
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Wait for push
uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
- name: Download image references
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}
- name: Extract operator image ref
id: operator-image-ref
run: |
source ./operator.refs
echo "operator-image-ref=${OPERATOR_IMAGE_REF}" >> $GITHUB_OUTPUT
- name: Run Trivy vulnerability scanner in IaC mode
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ steps.operator-image-ref.outputs.operator-image-ref }}
format: 'sarif'
ignore-unfixed: true
output: 'trivy-results.sarif'
severity: CRITICAL,HIGH,UNKNOWN
- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
source-scan:
name: Gosec code scanning
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run gosec
uses: securego/[email protected]
with:
args: '-no-fail -fmt sarif -out gosec.sarif ./...'
- name: Upload gosec scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'gosec.sarif'