1
+ name : Merge to release branches
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' release/**'
7
+
8
+ env :
9
+ SDK_VERSION : " 1.16.0"
10
+ GO111MODULE : on
11
+ K8S_VERSION : " 1.19.2"
12
+ CONTAINER_RUNTIME : " docker"
13
+ OPERATOR_REPO_REF : " quay.io/pmacik/sbo-test"
14
+
15
+ jobs :
16
+ release :
17
+ name : Release operator on Quay.io
18
+ runs-on : ubuntu-latest
19
+
20
+ steps :
21
+ - name : Checkout Git Repository
22
+ uses : actions/checkout@v2
23
+
24
+ - name : Set up PATH
25
+ run : |
26
+ mkdir -p $GITHUB_WORKSPACE/bin/
27
+ echo "PATH=$PATH:$GITHUB_WORKSPACE/bin/" >> $GITHUB_ENV
28
+
29
+ - name : Set up Go
30
+ uses : actions/setup-go@v2
31
+ with :
32
+ go-version : " ^1.16"
33
+
34
+ - name : Set up Python
35
+ uses : actions/setup-python@v2
36
+ with :
37
+ python-version : " 3.7"
38
+ architecture : " x64"
39
+
40
+ - name : Setup CLI
41
+ uses : ./.github/actions/setup-cli
42
+ with :
43
+ operator-sdk : true
44
+ kubectl : true
45
+
46
+ - name : Release operator on Quay.io
47
+ env :
48
+ QUAY_USERNAME : ${{ secrets.QUAY_USERNAME }}
49
+ QUAY_TOKEN : ${{ secrets.QUAY_TOKEN }}
50
+ run : |
51
+ export OPERATOR_INDEX_IMAGE_REF=$OPERATOR_REPO_REF:index-${GITHUB_REF_NAME#release/}
52
+ make release-operator
53
+
54
+ unit-tests-with-coverage :
55
+ name : Unit tests with code coverage for merge-to-master commits
56
+ runs-on : ubuntu-latest
57
+
58
+ steps :
59
+ - name : Checkout Git Repository
60
+ uses : actions/checkout@v2
61
+
62
+ - name : Set up Go
63
+ uses : actions/setup-go@v2
64
+ with :
65
+ go-version : " ^1.16"
66
+
67
+ - name : Unit Tests with Code Coverage
68
+ run : |
69
+ make test
70
+
71
+ - name : Upload Code Coverage Report
72
+ uses : codecov/codecov-action@v3
73
+ with :
74
+ file : cover.out
75
+ verbose : true
76
+ fail_ci_if_error : true
77
+
78
+ security-scan :
79
+ name : Security vulnerability scan
80
+ runs-on : ubuntu-20.04
81
+ steps :
82
+ - name : Checkout code
83
+ uses : actions/checkout@v2
84
+
85
+ - name : Wait for push
86
+ uses : lewagon/wait-on-check-action@1b1630e169116b58a4b933d5ad7effc46d3d312d
87
+ with :
88
+ ref : ${{ github.ref }}
89
+ check-name : " Release operator on Quay.io"
90
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
91
+ wait-interval : 60
92
+
93
+ - name : Extract operator image ref
94
+ id : operator-image-ref
95
+ run : |
96
+ export OIR=${OPERATOR_REPO_REF}:$(git rev-parse --short=8 HEAD)
97
+ echo "::set-output name=operator-image-ref::${OIR}"
98
+
99
+ - name : Run Trivy vulnerability scanner in IaC mode
100
+ uses : aquasecurity/trivy-action@master
101
+ with :
102
+ image-ref : ${{ steps.operator-image-ref.outputs.operator-image-ref }}
103
+ format : ' sarif'
104
+ severity : ' CRITICAL,HIGH'
105
+ ignore-unfixed : true
106
+ output : ' trivy-results.sarif'
107
+
108
+ - name : Upload Trivy scan results to GitHub Security tab
109
+ if : always()
110
+ uses : github/codeql-action/upload-sarif@v2
111
+ with :
112
+ sarif_file : ' trivy-results.sarif'
0 commit comments