FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
stackrox/.github/workflows/style.yaml at master · stackrox/stackrox · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
stackrox
/
stackrox
Public
Notifications
You must be signed in to change notification settings
Fork
190
Star
1.3k
Code
Issues
54
Pull requests
604
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
stackrox
/
.github
/
workflows
/
style.yaml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
346 lines (290 loc) · 11.9 KB
Breadcrumbs
stackrox
/
.github
/
workflows
/
style.yaml
Copy path
File metadata and controls
346 lines (290 loc) · 11.9 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
name
:
Style
on
:
push
:
tags
:
-
'
*
'
branches
:
-
master
-
release-*
pull_request
:
types
:
-
opened
-
reopened
-
synchronize
env
:
ROX_PRODUCT_BRANDING
:
RHACS_BRANDING
concurrency
:
group
:
${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress
:
true
jobs
:
detect-changes
:
uses
:
./.github/workflows/detect-changes.yml
check-generated-files
:
needs
:
detect-changes
if
:
${{ !needs.detect-changes.outputs.ui_only }}
env
:
ARTIFACT_DIR
:
junit-reports/
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
with
:
fetch-depth
:
0
ref
:
${{ github.event.pull_request.head.sha }}
-
uses
:
./.github/actions/job-preamble
with
:
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
name
:
Create artifacts dir
run
:
mkdir -p "$ARTIFACT_DIR"
#
No GOCACHE here — this job must validate go.mod/go.sum against
#
real source files, not a cached module index that may be stale.
-
name
:
Download scanner module for proto generation
run
:
go mod download github.com/stackrox/scanner
-
name
:
Check Generated
run
:
scripts/ci/jobs/check-generated.sh
misc-checks
:
env
:
ARTIFACT_DIR
:
junit-reports/
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
with
:
fetch-depth
:
0
ref
:
${{ github.event.pull_request.head.sha }}
-
uses
:
./.github/actions/job-preamble
with
:
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
name
:
Create artifacts dir
run
:
mkdir -p "$ARTIFACT_DIR"
-
name
:
Ensure no trailing whitespaces
if
:
github.event_name == 'pull_request'
#
Markdown files aren't checked for trailing whitespaces because it's a valid linebreak there.
#
Batch files are excluded because they are generated (e.g. gradle wrapper) and use Windows line endings.
run
:
git diff --check "${{ github.event.pull_request.base.sha }}"...HEAD ':(exclude)*.md' ':(exclude)*.bat'
-
name
:
Check PR fixes
run
:
scripts/ci/jobs/check-pr-fixes.sh
-
name
:
Check TODOs
run
:
scripts/ci/jobs/check-todos.sh
-
name
:
Check Policies
run
:
scripts/ci/jobs/policy-checks.sh
-
name
:
Check Konflux setup
run
:
scripts/ci/jobs/check-konflux-setup.sh
-
name
:
Check build & test image versions
run
:
scripts/ci/jobs/check-image-version.sh
-
name
:
Check dependabot knows about pinned prefetched images
run
:
scripts/ci/jobs/check-dependabot-pinned-image.sh
-
name
:
Check dependabot gomod configurations match go.mod files
run
:
if [ -s scripts/ci/jobs/check-dependabot-gomod.sh ]; then scripts/ci/jobs/check-dependabot-gomod.sh; fi
style-check
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
with
:
fetch-depth
:
0
ref
:
${{ github.event.pull_request.head.sha }}
-
uses
:
./.github/actions/job-preamble
with
:
free-disk-space
:
'
30
'
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
uses
:
actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
#
ratchet:actions/setup-node@v6
with
:
node-version-file
:
ui/package.json
-
name
:
Install xmlstarlet for shellcheck output to junit
run
:
|
sudo apt-get update -qq && sudo apt-get install -y -qq xmlstarlet
-
name
:
Install pycodestyle
run
:
|
python3 -m pip install -r .openshift-ci/dev-requirements.txt
-
name
:
Verify tools
run
:
|
yq --version
xmlstarlet --version
pycodestyle --version
-
name
:
Cache Go dependencies
uses
:
./.github/actions/cache-go-dependencies
-
name
:
Download scanner module for proto generation
run
:
go mod download github.com/stackrox/scanner
-
name
:
Cache UI dependencies
id
:
cache-ui
uses
:
./.github/actions/cache-ui-dependencies
-
name
:
Cache QA Test dependencies
uses
:
./.github/actions/cache-gradle-dependencies
-
name
:
Fetch UI deps
if
:
steps.cache-ui.outputs.cache-hit != 'true'
run
:
make -C ui deps
-
name
:
Skip UI deps on cache hit
if
:
steps.cache-ui.outputs.cache-hit == 'true'
run
:
touch ui/deps
-
name
:
Cache ESLint results
uses
:
./.github/actions/cache-eslint
-
name
:
make style-slim
run
:
make style-slim
golangci-lint
:
needs
:
detect-changes
if
:
${{ !needs.detect-changes.outputs.ui_only }}
timeout-minutes
:
240
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
-
uses
:
./.github/actions/job-preamble
with
:
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
name
:
Check Cache golangci-lint
run
:
make golangci-lint-cache-status
-
name
:
Cache golangci-lint
if
:
github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
uses
:
actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
#
ratchet:actions/cache@v6
with
:
path
:
${{ env.HOME }}/.cache/golangci-lint
key
:
go-lint-v2-${{ hashFiles('**/go.sum') }}
restore-keys
:
|
go-lint-v2-
-
name
:
Restore golangci-lint analysis cache
if
:
${{ !(github.event_name == 'push' && github.ref_name == github.event.repository.default_branch) }}
uses
:
actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
#
ratchet:actions/cache/restore@v6
with
:
path
:
${{ env.HOME }}/.cache/golangci-lint
key
:
go-lint-v2-${{ hashFiles('**/go.sum') }}
restore-keys
:
|
go-lint-v2-
-
name
:
Check cache golangci-lint
run
:
make golangci-lint-cache-status
-
name
:
Check Go version is in sync in .golangci.yml and go.mod
run
:
|
[ "$(awk '/^go /{print $2}' go.mod | cut -d. -f 1-2)" = "$(yq e .run.go .golangci.yml)" ]
-
name
:
make golangci-lint
run
:
make golangci-lint
-
name
:
Check Cache golangci-lint
run
:
make golangci-lint-cache-status
check-dependent-images-exist
:
needs
:
detect-changes
if
:
${{ !needs.detect-changes.outputs.ui_only }}
#
This job ensures that COLLECTOR_VERSION, FACT_VERSION or SCANNER_VERSION files cannot be updated to a version
#
for which the image was not successfully built on Konflux (suffix "-fast"). It also verifies that GHA-built image
#
is there (no suffix) so that the failure also happens in this job.
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout repo
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
-
uses
:
./.github/actions/job-preamble
with
:
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
name
:
Get image tags from COLLECTOR|FACT|SCANNER_VERSION file
run
:
|
{
echo "collector_tag=$(make --quiet --no-print-directory collector-tag)"
echo "fact_tag=$(make --quiet --no-print-directory fact-tag)"
echo "scanner_tag=$(make --quiet --no-print-directory scanner-tag)"
} >> "$GITHUB_ENV"
-
name
:
Check GHA-built image exists
uses
:
stackrox/actions/release/wait-for-image@9238e423c3ae1ac4eb0f254cbb98da9daae24d86
#
ratchet:stackrox/actions/release/wait-for-image@v1
#
Skip for external contributions.
if
:
|
github.event_name == 'push' || !github.event.pull_request.head.repo.fork
with
:
token
:
${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }}
limit
:
300
image
:
|
rhacs-eng/collector:${{ env.collector_tag }}
rhacs-eng/fact:${{ env.fact_tag }}
rhacs-eng/scanner:${{ env.scanner_tag }}
rhacs-eng/scanner-slim:${{ env.scanner_tag }}
rhacs-eng/scanner-db:${{ env.scanner_tag }}
rhacs-eng/scanner-db-slim:${{ env.scanner_tag }}
-
name
:
Check Konflux-built image exists
uses
:
stackrox/actions/release/wait-for-image@9238e423c3ae1ac4eb0f254cbb98da9daae24d86
#
ratchet:stackrox/actions/release/wait-for-image@v1
#
Skip for external contributions.
if
:
|
github.event_name == 'push' || !github.event.pull_request.head.repo.fork
with
:
token
:
${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }}
limit
:
300
image
:
|
rhacs-eng/release-collector:${{ env.collector_tag }}-fast
rhacs-eng/release-fact:${{ env.fact_tag }}-fast
rhacs-eng/release-scanner:${{ env.scanner_tag }}-fast
rhacs-eng/release-scanner-slim:${{ env.scanner_tag }}-fast
rhacs-eng/release-scanner-db:${{ env.scanner_tag }}-fast
rhacs-eng/release-scanner-db-slim:${{ env.scanner_tag }}-fast
github-actions-lint
:
needs
:
detect-changes
if
:
>-
!needs.detect-changes.outputs.files ||
contains(needs.detect-changes.outputs.files, '^.github/')
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
-
uses
:
./.github/actions/job-preamble
with
:
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
name
:
Check workflow files
run
:
make github-actions-lint
github-actions-shellcheck
:
needs
:
detect-changes
if
:
>-
!needs.detect-changes.outputs.files ||
contains(needs.detect-changes.outputs.files, '^.github/')
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
-
uses
:
./.github/actions/job-preamble
with
:
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
name
:
Check scripts with shellcheck
run
:
shellcheck -P SCRIPTDIR -x ./.github/workflows/scripts/*.sh
openshift-ci-lint
:
needs
:
detect-changes
if
:
>-
!needs.detect-changes.outputs.files ||
contains(needs.detect-changes.outputs.files, '^.openshift-ci/')
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
with
:
fetch-depth
:
0
ref
:
${{ github.event.pull_request.head.sha }}
-
uses
:
./.github/actions/job-preamble
with
:
gcp-account
:
${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }}
-
name
:
Install Python linters
run
:
python3 -m pip install -r .openshift-ci/dev-requirements.txt
-
name
:
pycodestyle
run
:
make -C .openshift-ci style
-
name
:
Pylint
run
:
make -C .openshift-ci lint
slack-on-style-failure
:
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
SLACK_CI_INTEGRATION_TESTING_WEBHOOK
:
${{ secrets.SLACK_CI_INTEGRATION_TESTING_WEBHOOK }}
TEST_FAILURES_NOTIFY_WEBHOOK
:
${{ secrets.TEST_FAILURES_NOTIFY_WEBHOOK }}
if
:
|
failure() && (
github.event_name == 'push' ||
contains(github.event.pull_request.labels.*.name, 'ci-test-github-action-slack-messages')
)
name
:
Post failure message to Slack
runs-on
:
ubuntu-latest
needs
:
-
check-generated-files
-
misc-checks
-
style-check
-
golangci-lint
-
check-dependent-images-exist
-
github-actions-lint
-
github-actions-shellcheck
-
openshift-ci-lint
permissions
:
actions
:
read
steps
:
-
name
:
Checkout
uses
:
actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
#
ratchet:actions/checkout@v7.0.0
-
name
:
Slack message
env
:
GITHUB_CONTEXT
:
${{ toJSON(github) }}
run
:
|
source scripts/ci/lib.sh
slack_workflow_failure
Back
|
FazBrowse Home
|
New Git URL