99 default : ' 22.1.0'
1010
1111jobs :
12+ commit-lint :
13+ name : Commit Lint
14+ runs-on : ubuntu-latest
15+ if : github.event_name == 'pull_request'
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 0
21+
22+ - name : Setup Node.js
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : ${{ inputs.node-version }}
26+ cache : ' yarn'
27+
28+ - name : Cache dependencies
29+ uses : actions/cache@v3
30+ id : node-modules-cache
31+ with :
32+ path : ' **/node_modules'
33+ key : ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
34+ restore-keys : |
35+ ${{ runner.os }}-modules-
36+
37+ - name : Install dependencies
38+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
39+ run : yarn install
40+
41+ - name : Validate PR commits with commitlint
42+ run : npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
43+
1244 build :
1345 name : Build
1446 runs-on : ubuntu-latest
2254 node-version : ${{ inputs.node-version }}
2355 cache : ' yarn'
2456
57+ - name : Cache dependencies
58+ uses : actions/cache@v3
59+ id : node-modules-cache
60+ with :
61+ path : ' **/node_modules'
62+ key : ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
63+ restore-keys : |
64+ ${{ runner.os }}-modules-
65+
2566 - name : Install dependencies
67+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
2668 run : yarn install
2769
2870 - name : Build
4183 node-version : ${{ inputs.node-version }}
4284 cache : ' yarn'
4385
86+ - name : Cache dependencies
87+ uses : actions/cache@v3
88+ id : node-modules-cache
89+ with :
90+ path : ' **/node_modules'
91+ key : ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
92+ restore-keys : |
93+ ${{ runner.os }}-modules-
94+
4495 - name : Install dependencies
96+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
4597 run : yarn install
4698
4799 - name : Lint
@@ -60,7 +112,17 @@ jobs:
60112 node-version : ${{ inputs.node-version }}
61113 cache : ' yarn'
62114
115+ - name : Cache dependencies
116+ uses : actions/cache@v3
117+ id : node-modules-cache
118+ with :
119+ path : ' **/node_modules'
120+ key : ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
121+ restore-keys : |
122+ ${{ runner.os }}-modules-
123+
63124 - name : Install dependencies
125+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
64126 run : yarn install
65127
66128 - name : Generate test SSL certificates
0 commit comments