|
36 | 36 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
37 | 37 | with: |
38 | 38 | node-version: 24.6.0 |
39 | | - - name: Restore Node dependencies cache |
40 | | - id: cache-node-modules |
41 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
42 | | - with: |
43 | | - path: | |
44 | | - node_modules |
45 | | - ~/.npm |
46 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
47 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
48 | | - - name: Install Node dependencies |
49 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
50 | | - run: npm ci --ignore-scripts |
| 39 | + - name: Install and Cache Node Dependencies |
| 40 | + uses: ./.github/actions/install-and-cache-node-deps |
51 | 41 | - name: Lint |
52 | 42 | run: npm run ci:lint |
53 | 43 | - name: Vulnerabilities |
@@ -243,26 +233,8 @@ jobs: |
243 | 233 | run: ${{ matrix.settings.setup }} |
244 | 234 | if: ${{ matrix.settings.setup }} |
245 | 235 | shell: bash |
246 | | - - name: Restore Node dependencies cache |
247 | | - id: cache-node-modules |
248 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
249 | | - with: |
250 | | - path: | |
251 | | - node_modules |
252 | | - ~/.npm |
253 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
254 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
255 | | - - name: Install Node dependencies |
256 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
257 | | - run: npm ${{ github.ref == 'refs/heads/master' && 'ci' || 'install' }} --ignore-scripts |
258 | | - - name: Save Node dependencies cache |
259 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master' |
260 | | - uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
261 | | - with: |
262 | | - path: | |
263 | | - node_modules |
264 | | - ~/.npm |
265 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
| 236 | + - name: Install and Cache Node Dependencies |
| 237 | + uses: ./.github/actions/install-and-cache-node-deps |
266 | 238 | - name: Build in docker |
267 | 239 | uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 |
268 | 240 | if: ${{ matrix.settings.docker }} |
@@ -344,18 +316,8 @@ jobs: |
344 | 316 | steps: |
345 | 317 | - name: Checkout Commit |
346 | 318 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
347 | | - - name: Restore Node dependencies cache |
348 | | - id: cache-node-modules |
349 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
350 | | - with: |
351 | | - path: | |
352 | | - node_modules |
353 | | - ~/.npm |
354 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
355 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
356 | | - - name: Install Node dependencies |
357 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
358 | | - run: npm install --ignore-scripts |
| 319 | + - name: Install and Cache Node Dependencies |
| 320 | + uses: ./.github/actions/install-and-cache-node-deps |
359 | 321 | - name: Build JS |
360 | 322 | run: npm run build:cjs |
361 | 323 | - name: Download napi artifacts |
@@ -450,18 +412,8 @@ jobs: |
450 | 412 | with: |
451 | 413 | node-version: ${{ matrix.node }} |
452 | 414 | check-latest: true |
453 | | - - name: Restore Node dependencies cache |
454 | | - id: cache-node-modules |
455 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
456 | | - with: |
457 | | - path: | |
458 | | - node_modules |
459 | | - ~/.npm |
460 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
461 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
462 | | - - name: Install Node dependencies |
463 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
464 | | - run: npm install --ignore-scripts |
| 415 | + - name: Install and Cache Node Dependencies |
| 416 | + uses: ./.github/actions/install-and-cache-node-deps |
465 | 417 | - name: Download napi artifacts |
466 | 418 | uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 |
467 | 419 | with: |
@@ -508,18 +460,8 @@ jobs: |
508 | 460 | with: |
509 | 461 | node-version: ${{ matrix.node }} |
510 | 462 | check-latest: true |
511 | | - - name: Restore Node dependencies cache |
512 | | - id: cache-node-modules |
513 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
514 | | - with: |
515 | | - path: | |
516 | | - node_modules |
517 | | - ~/.npm |
518 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
519 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
520 | | - - name: Install Node dependencies |
521 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
522 | | - run: npm install --ignore-scripts |
| 463 | + - name: Install and Cache Node Dependencies |
| 464 | + uses: ./.github/actions/install-and-cache-node-deps |
523 | 465 | - name: Download all artifacts |
524 | 466 | uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 |
525 | 467 | with: |
|
0 commit comments