@@ -22,10 +22,10 @@ concurrency:
22
22
# will skip running `yarn install` if it successfully fetched from cache
23
23
24
24
jobs :
25
- prebuild :
26
- name : Pre-build checks
25
+ fmt :
26
+ name : Format with Prettier
27
27
runs-on : ubuntu-latest
28
- timeout-minutes : 20
28
+ timeout-minutes : 5
29
29
steps :
30
30
- name : Checkout repo
31
31
uses : actions/checkout@v3
@@ -47,21 +47,24 @@ jobs:
47
47
id : cache-node-modules
48
48
uses : actions/cache@v3
49
49
with :
50
- path : " **/ node_modules"
51
- key : yarn-build-${{ hashFiles('**/ yarn.lock') }}
50
+ path : " node_modules"
51
+ key : yarn-build-${{ hashFiles('yarn.lock') }}
52
52
restore-keys : |
53
53
yarn-build-
54
54
55
55
- name : Install dependencies
56
- if : steps.cache-node-modules .outputs.cache-hit != 'true'
56
+ if : steps.cache-yarn .outputs.cache-hit != 'true'
57
57
run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
58
58
59
- - name : Run yarn fmt
59
+ - name : Format files with Prettier
60
60
run : yarn fmt
61
- if : success()
62
61
63
- lint-sh :
64
- name : Lint shell files
62
+ - name : Fail workflow
63
+ if : failure()
64
+ uses : andymckay/cancel-action@0.2
65
+
66
+ lint-helm :
67
+ name : Lint Helm chart
65
68
runs-on : ubuntu-latest
66
69
timeout-minutes : 5
67
70
steps :
@@ -73,39 +76,23 @@ jobs:
73
76
uses : tj-actions/changed-files@v23.2
74
77
with :
75
78
files : |
76
- **.sh
77
- **.bats
78
-
79
- - name : Install Node.js v16
80
- if : steps.changed-files.outputs.any_changed == 'true'
81
- uses : actions/setup-node@v3
82
- with :
83
- node-version : " 16"
79
+ ci/helm-chart/**
84
80
85
- - name : Fetch dependencies from cache
86
- if : steps.changed-files.outputs.any_changed == 'true'
87
- id : cache-yarn
88
- uses : actions/cache@v3
81
+ - name : Install helm
82
+ uses : azure/setup-helm@v3.3
89
83
with :
90
- path : " node_modules"
91
- key : yarn-build-${{ hashFiles('yarn.lock') }}
92
- restore-keys : |
93
- yarn-build-
94
-
95
- - name : Install dependencies
96
- if : steps.changed-files.outputs.any_changed == 'true' && steps.cache-yarn.outputs.cache-hit != 'true'
97
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
84
+ token : ${{ secrets.GITHUB_TOKEN }}
98
85
99
- - name : Lint shell files
86
+ - name : Lint Helm chart
100
87
if : steps.changed-files.outputs.any_changed == 'true'
101
- run : yarn lint: sh
88
+ run : ./ci/dev/helm. sh
102
89
103
90
- name : Fail workflow
104
91
if : failure()
105
92
uses : andymckay/cancel-action@0.2
106
93
107
- typecheck :
108
- name : Check TypeScript types
94
+ lint-sh :
95
+ name : Lint shell files
109
96
runs-on : ubuntu-latest
110
97
timeout-minutes : 5
111
98
steps :
@@ -117,7 +104,8 @@ jobs:
117
104
uses : tj-actions/changed-files@v23.2
118
105
with :
119
106
files : |
120
- ./src/**/*
107
+ **.sh
108
+ **.bats
121
109
122
110
- name : Install Node.js v16
123
111
if : steps.changed-files.outputs.any_changed == 'true'
@@ -139,9 +127,9 @@ jobs:
139
127
if : steps.changed-files.outputs.any_changed == 'true' && steps.cache-yarn.outputs.cache-hit != 'true'
140
128
run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
141
129
142
- - name : Run tsc on TypeScript files
130
+ - name : Lint shell files
143
131
if : steps.changed-files.outputs.any_changed == 'true'
144
- run : yarn typecheck
132
+ run : yarn lint:sh
145
133
146
134
- name : Fail workflow
147
135
if : failure()
@@ -194,8 +182,8 @@ jobs:
194
182
if : failure()
195
183
uses : andymckay/cancel-action@0.2
196
184
197
- lint-helm :
198
- name : Lint Helm chart
185
+ typecheck :
186
+ name : Check TypeScript types
199
187
runs-on : ubuntu-latest
200
188
timeout-minutes : 5
201
189
steps :
@@ -207,24 +195,38 @@ jobs:
207
195
uses : tj-actions/changed-files@v23.2
208
196
with :
209
197
files : |
210
- ci/helm-chart/* *
198
+ ./src/**/ *
211
199
212
- - name : Install helm
213
- uses : azure/setup-helm@v3.3
200
+ - name : Install Node.js v16
201
+ if : steps.changed-files.outputs.any_changed == 'true'
202
+ uses : actions/setup-node@v3
214
203
with :
215
- token : ${{ secrets.GITHUB_TOKEN }}
204
+ node-version : " 16 "
216
205
217
- - name : Lint Helm chart
206
+ - name : Fetch dependencies from cache
218
207
if : steps.changed-files.outputs.any_changed == 'true'
219
- run : ./ci/dev/helm.sh
208
+ id : cache-yarn
209
+ uses : actions/cache@v3
210
+ with :
211
+ path : " node_modules"
212
+ key : yarn-build-${{ hashFiles('yarn.lock') }}
213
+ restore-keys : |
214
+ yarn-build-
215
+
216
+ - name : Install dependencies
217
+ if : steps.changed-files.outputs.any_changed == 'true' && steps.cache-yarn.outputs.cache-hit != 'true'
218
+ run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
219
+
220
+ - name : Run tsc on TypeScript files
221
+ if : steps.changed-files.outputs.any_changed == 'true'
222
+ run : yarn typecheck
220
223
221
224
- name : Fail workflow
222
225
if : failure()
223
226
uses : andymckay/cancel-action@0.2
224
227
225
228
build :
226
229
name : Build
227
- needs : prebuild
228
230
runs-on : ubuntu-latest
229
231
timeout-minutes : 30
230
232
env :
0 commit comments