7
7
branches : [ main ]
8
8
9
9
jobs :
10
+ setup :
11
+ name : Setup & Install
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+ - name : Set up JDK 11 (LTS)
16
+ uses : actions/setup-java@v1
17
+ with :
18
+ java-version : 11
19
+ architecture : x64
20
+ - name : Restore Maven cache
21
+ uses : actions/cache@v2
22
+ with :
23
+ path : ~/.m2
24
+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
25
+ restore-keys : ${{ runner.os }}-m2
26
+ - run : java --version && mvn --version
27
+ - name : Install Dependencies
28
+ run : mvn install -DskipTests -Dspotbugs.skip=true -Ddependency-check.skip=true
29
+
10
30
secret-scan :
11
31
name : Secret scanner
12
32
runs-on : ubuntu-latest
28
48
build :
29
49
name : Build & Unit Tests
30
50
runs-on : ubuntu-latest
51
+ needs : [ setup, secret-scan ]
31
52
steps :
32
53
- uses : actions/checkout@v2
33
54
- name : Set up JDK 11 (LTS)
66
87
- run : echo ${{ steps.docker_build.outputs.digest }}
67
88
68
89
oss-scan :
69
- name : OSS Scan
90
+ name : SCA - Dependency Checker
70
91
runs-on : ubuntu-latest
71
- needs : build
92
+ needs : [ setup, secret-scan ]
72
93
steps :
73
94
- uses : actions/checkout@v2
74
95
- name : Run Snyk to check for vulnerabilities
78
99
SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
79
100
with :
80
101
args : --severity-threshold=high
102
+
103
+ license_check :
104
+ name : License Checker
105
+ runs-on : ubuntu-latest
106
+ needs : [ setup, secret-scan ]
107
+ steps :
108
+ - name : Checkout the code
109
+ uses : actions/checkout@master
110
+ - name : Set up JDK 11 (LTS)
111
+ uses : actions/setup-java@v1
112
+ with :
113
+ java-version : 11
114
+ architecture : x64
115
+ - name : Restore Maven cache
116
+ uses : actions/cache@v2
117
+ with :
118
+ path : ~/.m2
119
+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
120
+ restore-keys : ${{ runner.os }}-m2
121
+ - uses : ruby/setup-ruby@v1
122
+ with :
123
+ ruby-version : 2.7.2
124
+ bundler-cache : false
125
+ - run : gem install license_finder
126
+ - run : license_finder
127
+
81
128
sast :
82
129
name : Static Code Analysis
83
130
runs-on : ubuntu-latest
@@ -112,7 +159,7 @@ jobs:
112
159
- name : Perform CodeQL Analysis
113
160
uses : github/codeql-action/analyze@v1
114
161
115
- container :
162
+ container-scan :
116
163
name : Scan Container Image
117
164
runs-on : ubuntu-latest
118
165
needs : build
@@ -128,6 +175,7 @@ jobs:
128
175
uses : github/codeql-action/upload-sarif@v1
129
176
with :
130
177
sarif_file : ${{ steps.scan.outputs.sarif }}
178
+
131
179
container-lint :
132
180
name : Lint Dockerfile
133
181
runs-on : ubuntu-latest
@@ -138,6 +186,7 @@ jobs:
138
186
image : ghcr.io/${{ github.repository }}/app:latest
139
187
exit-code : ' 1'
140
188
exit-level : FATAL
189
+
141
190
k8s-lint :
142
191
name : K8s Hardening
143
192
runs-on : ubuntu-latest
@@ -149,34 +198,18 @@ jobs:
149
198
with :
150
199
input : pod.yaml
151
200
exit-code : " 0"
152
- license_check :
153
- name : License Checker
201
+
202
+ deploy :
203
+ name : Deploy to Test Environment
154
204
runs-on : ubuntu-latest
155
- needs : build
205
+ needs : [sast, container-scan, container-lint, k8s-lint, oss-scan, license_check ]
156
206
steps :
157
- - name : Checkout the code
158
- uses : actions/checkout@master
159
- - name : Set up JDK 11 (LTS)
160
- uses : actions/setup-java@v1
161
- with :
162
- java-version : 11
163
- architecture : x64
164
- - name : Restore Maven cache
165
- uses : actions/cache@v2
166
- with :
167
- path : ~/.m2
168
- key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
169
- restore-keys : ${{ runner.os }}-m2
170
- - uses : ruby/setup-ruby@v1
171
- with :
172
- ruby-version : 2.7.2
173
- bundler-cache : false
174
- - run : gem install license_finder
175
- - run : license_finder
207
+ - run : echo done
208
+
176
209
dast :
177
210
runs-on : ubuntu-latest
178
211
name : DAST
179
- needs : build
212
+ needs : deploy
180
213
steps :
181
214
- name : Checkout
182
215
uses : actions/checkout@v2
0 commit comments