Skip to content

Commit bbfbab4

Browse files
committed
refactor: remove prebuild
1 parent fe70ebf commit bbfbab4

File tree

1 file changed

+48
-46
lines changed

1 file changed

+48
-46
lines changed

.github/workflows/build.yaml

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ concurrency:
2222
# will skip running `yarn install` if it successfully fetched from cache
2323

2424
jobs:
25-
prebuild:
26-
name: Pre-build checks
25+
fmt:
26+
name: Format with Prettier
2727
runs-on: ubuntu-latest
28-
timeout-minutes: 20
28+
timeout-minutes: 5
2929
steps:
3030
- name: Checkout repo
3131
uses: actions/checkout@v3
@@ -47,21 +47,24 @@ jobs:
4747
id: cache-node-modules
4848
uses: actions/cache@v3
4949
with:
50-
path: "**/node_modules"
51-
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
50+
path: "node_modules"
51+
key: yarn-build-${{ hashFiles('yarn.lock') }}
5252
restore-keys: |
5353
yarn-build-
5454
5555
- name: Install dependencies
56-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
56+
if: steps.cache-yarn.outputs.cache-hit != 'true'
5757
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
5858

59-
- name: Run yarn fmt
59+
- name: Format files with Prettier
6060
run: yarn fmt
61-
if: success()
6261

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
6568
runs-on: ubuntu-latest
6669
timeout-minutes: 5
6770
steps:
@@ -73,39 +76,23 @@ jobs:
7376
uses: tj-actions/changed-files@v23.2
7477
with:
7578
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/**
8480
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
8983
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 }}
9885

99-
- name: Lint shell files
86+
- name: Lint Helm chart
10087
if: steps.changed-files.outputs.any_changed == 'true'
101-
run: yarn lint:sh
88+
run: ./ci/dev/helm.sh
10289

10390
- name: Fail workflow
10491
if: failure()
10592
uses: andymckay/cancel-action@0.2
10693

107-
typecheck:
108-
name: Check TypeScript types
94+
lint-sh:
95+
name: Lint shell files
10996
runs-on: ubuntu-latest
11097
timeout-minutes: 5
11198
steps:
@@ -117,7 +104,8 @@ jobs:
117104
uses: tj-actions/changed-files@v23.2
118105
with:
119106
files: |
120-
./src/**/*
107+
**.sh
108+
**.bats
121109
122110
- name: Install Node.js v16
123111
if: steps.changed-files.outputs.any_changed == 'true'
@@ -139,9 +127,9 @@ jobs:
139127
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-yarn.outputs.cache-hit != 'true'
140128
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
141129

142-
- name: Run tsc on TypeScript files
130+
- name: Lint shell files
143131
if: steps.changed-files.outputs.any_changed == 'true'
144-
run: yarn typecheck
132+
run: yarn lint:sh
145133

146134
- name: Fail workflow
147135
if: failure()
@@ -194,8 +182,8 @@ jobs:
194182
if: failure()
195183
uses: andymckay/cancel-action@0.2
196184

197-
lint-helm:
198-
name: Lint Helm chart
185+
typecheck:
186+
name: Check TypeScript types
199187
runs-on: ubuntu-latest
200188
timeout-minutes: 5
201189
steps:
@@ -207,24 +195,38 @@ jobs:
207195
uses: tj-actions/changed-files@v23.2
208196
with:
209197
files: |
210-
ci/helm-chart/**
198+
./src/**/*
211199
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
214203
with:
215-
token: ${{ secrets.GITHUB_TOKEN }}
204+
node-version: "16"
216205

217-
- name: Lint Helm chart
206+
- name: Fetch dependencies from cache
218207
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
220223

221224
- name: Fail workflow
222225
if: failure()
223226
uses: andymckay/cancel-action@0.2
224227

225228
build:
226229
name: Build
227-
needs: prebuild
228230
runs-on: ubuntu-latest
229231
timeout-minutes: 30
230232
env:

0 commit comments

Comments
 (0)