Skip to content

Commit 1172754

Browse files
committed
refactor: rename jobs and improve caching in CI workflow
1 parent 57f77c4 commit 1172754

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

.github/workflows/Build and test.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Verify, build & test'
1+
name: 'CI build & test'
22

33
on:
44
push:
@@ -9,7 +9,7 @@ on:
99
permissions: read-all
1010

1111
jobs:
12-
job-verify-formatting:
12+
'Verify Formatting':
1313
permissions:
1414
contents: read
1515
runs-on: blacksmith-4vcpu-ubuntu-2204
@@ -26,14 +26,22 @@ jobs:
2626
with:
2727
node-version: '24.x'
2828

29+
- name: Cache Yarn dependencies
30+
uses: actions/cache@13aacd865c20de90e7f32385cc9f60de075b8dc3 # v4.0.0
31+
with:
32+
path: '**/node_modules'
33+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-yarn-
36+
2937
- name: Install dependencies
3038
run: yarn install --frozen-lockfile
3139

3240
- name: Verify formatting
33-
run: yarn test-format-only
41+
run: yarn test-format-all
3442

35-
job-build:
36-
needs: [job-verify-formatting]
43+
'Build':
44+
needs: ['Verify Formatting']
3745
permissions:
3846
contents: write
3947
runs-on: blacksmith-4vcpu-ubuntu-2204
@@ -50,6 +58,14 @@ jobs:
5058
with:
5159
node-version: '24.x'
5260

61+
- name: Cache Yarn dependencies
62+
uses: actions/cache@13aacd865c20de90e7f32385cc9f60de075b8dc3 # v4.0.0
63+
with:
64+
path: '**/node_modules'
65+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
66+
restore-keys: |
67+
${{ runner.os }}-yarn-
68+
5369
- name: Install dependencies
5470
run: yarn install --frozen-lockfile
5571

@@ -69,14 +85,14 @@ jobs:
6985
name: node_modules
7086
path: node_modules.tar
7187

72-
job-test-node:
88+
'Test Node':
7389
permissions:
7490
contents: read
75-
needs: [job-verify-formatting, job-build]
91+
needs: ['Verify Formatting', 'Build']
7692
runs-on: blacksmith-4vcpu-ubuntu-2204
7793
strategy:
7894
matrix:
79-
node-version: [16.x, 18.x, 20.x, 22.x, 23.x, 24.x, latest]
95+
node-version: [16.x, 18.x, 20.x, 22.x, 24.x] # Dropped '23.x' (EOL) and 'latest' for stability
8096
steps:
8197
- name: Harden Runner
8298
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
@@ -106,10 +122,10 @@ jobs:
106122
- name: Run Node tests
107123
run: yarn test-ci
108124

109-
job-test-browser:
125+
'Test Browser':
110126
permissions:
111127
contents: read
112-
needs: [job-verify-formatting, job-build]
128+
needs: ['Verify Formatting', 'Build']
113129
runs-on: blacksmith-4vcpu-ubuntu-2204
114130
steps:
115131
- name: Harden Runner

0 commit comments

Comments
 (0)