@@ -64,10 +64,12 @@ jobs:
64
64
- '**'
65
65
docs:
66
66
- 'docs/**'
67
- # For testing:
68
- # - '.github/**'
69
67
sh:
70
68
- "**.sh"
69
+ go:
70
+ - "**.go"
71
+ tf:
72
+ - "**.tf"
71
73
ts:
72
74
- 'site/**'
73
75
k8s:
92
94
name : style/lint/golangci
93
95
timeout-minutes : 5
94
96
runs-on : ubuntu-latest
97
+ needs : changes
98
+ if : needs.changes.outputs.go == 'true'
95
99
steps :
96
100
- uses : actions/checkout@v3
97
101
- uses : actions/setup-go@v3
@@ -115,6 +119,8 @@ jobs:
115
119
name : style/lint/shellcheck
116
120
timeout-minutes : 5
117
121
runs-on : ubuntu-latest
122
+ needs : changes
123
+ if : needs.changes.outputs.sh == 'true'
118
124
steps :
119
125
- uses : actions/checkout@v3
120
126
- name : Run ShellCheck
@@ -128,6 +134,8 @@ jobs:
128
134
name : " style/lint/typescript"
129
135
timeout-minutes : 5
130
136
runs-on : ubuntu-latest
137
+ needs : changes
138
+ if : needs.changes.outputs.ts == 'true'
131
139
steps :
132
140
- name : Checkout
133
141
uses : actions/checkout@v3
@@ -247,6 +255,8 @@ jobs:
247
255
name : " style/fmt"
248
256
runs-on : ubuntu-latest
249
257
timeout-minutes : 5
258
+ needs : changes
259
+ if : needs.changes.outputs.sh == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.tf == 'true'
250
260
steps :
251
261
- name : Checkout
252
262
uses : actions/checkout@v3
@@ -280,6 +290,7 @@ jobs:
280
290
name : " test/go"
281
291
runs-on : ${{ matrix.os }}
282
292
timeout-minutes : 20
293
+ needs : changes
283
294
strategy :
284
295
matrix :
285
296
os :
@@ -288,30 +299,36 @@ jobs:
288
299
- windows-2022
289
300
steps :
290
301
- uses : actions/checkout@v3
302
+ if : needs.changes.outputs.go == 'true'
291
303
292
304
- uses : actions/setup-go@v3
305
+ if : needs.changes.outputs.go == 'true'
293
306
with :
294
307
go-version : " ~1.19"
295
308
296
309
- name : Echo Go Cache Paths
310
+ if : needs.changes.outputs.go == 'true'
297
311
id : go-cache-paths
298
312
run : |
299
313
echo "::set-output name=go-build::$(go env GOCACHE)"
300
314
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
301
315
302
316
- name : Go Build Cache
317
+ if : needs.changes.outputs.go == 'true'
303
318
uses : actions/cache@v3
304
319
with :
305
320
path : ${{ steps.go-cache-paths.outputs.go-build }}
306
321
key : ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}
307
322
308
323
- name : Go Mod Cache
324
+ if : needs.changes.outputs.go == 'true'
309
325
uses : actions/cache@v3
310
326
with :
311
327
path : ${{ steps.go-cache-paths.outputs.go-mod }}
312
328
key : ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
313
329
314
330
- name : Install gotestsum
331
+ if : needs.changes.outputs.go == 'true'
315
332
uses : jaxxstorm/action-install-gh-release@v1.7.1
316
333
env :
317
334
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -320,11 +337,13 @@ jobs:
320
337
tag : v1.7.0
321
338
322
339
- uses : hashicorp/setup-terraform@v2
340
+ if : needs.changes.outputs.go == 'true'
323
341
with :
324
342
terraform_version : 1.1.9
325
343
terraform_wrapper : false
326
344
327
345
- name : Test with Mock Database
346
+ if : needs.changes.outputs.go == 'true'
328
347
id : test
329
348
shell : bash
330
349
run : |
@@ -350,7 +369,7 @@ jobs:
350
369
# that is no guarantee, see:
351
370
# https://github.com/codecov/codecov-action/issues/788
352
371
continue-on-error : true
353
- if : steps.test.outputs.cover && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
372
+ if : steps.test.outputs.cover && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && needs.changes.outputs.go == 'true'
354
373
with :
355
374
token : ${{ secrets.CODECOV_TOKEN }}
356
375
files : ./gotests.coverage
@@ -364,6 +383,8 @@ jobs:
364
383
# goroutines. Setting this to the timeout +5m should work quite well
365
384
# even if some of the preceding steps are slow.
366
385
timeout-minutes : 25
386
+ needs : changes
387
+ if : needs.changes.outputs.go == 'true'
367
388
steps :
368
389
- uses : actions/checkout@v3
369
390
@@ -518,6 +539,8 @@ jobs:
518
539
name : " test/js"
519
540
runs-on : ubuntu-latest
520
541
timeout-minutes : 20
542
+ needs : changes
543
+ if : needs.changes.outputs.ts == 'true'
521
544
steps :
522
545
- uses : actions/checkout@v3
523
546
@@ -556,9 +579,8 @@ jobs:
556
579
557
580
test-e2e :
558
581
name : " test/e2e/${{ matrix.os }}"
559
- needs :
560
- - changes
561
- if : needs.changes.outputs.docs-only == 'false'
582
+ needs : changes
583
+ if : needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.tf == 'true'
562
584
runs-on : ${{ matrix.os }}
563
585
timeout-minutes : 20
564
586
strategy :
0 commit comments