|
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 |
@@ -245,26 +235,8 @@ jobs: |
245 | 235 | run: ${{ matrix.settings.setup }} |
246 | 236 | if: ${{ matrix.settings.setup }} |
247 | 237 | shell: bash |
248 | | - - name: Restore Node dependencies cache |
249 | | - id: cache-node-modules |
250 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
251 | | - with: |
252 | | - path: | |
253 | | - node_modules |
254 | | - ~/.npm |
255 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
256 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
257 | | - - name: Install Node dependencies |
258 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
259 | | - run: npm ${{ github.ref == 'refs/heads/master' && 'ci' || 'install' }} --ignore-scripts |
260 | | - - name: Save Node dependencies cache |
261 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master' |
262 | | - uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
263 | | - with: |
264 | | - path: | |
265 | | - node_modules |
266 | | - ~/.npm |
267 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
| 238 | + - name: Install and Cache Node Dependencies |
| 239 | + uses: ./.github/actions/install-and-cache-node-deps |
268 | 240 | - name: Build in docker |
269 | 241 | uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 |
270 | 242 | if: ${{ matrix.settings.docker }} |
@@ -346,18 +318,8 @@ jobs: |
346 | 318 | steps: |
347 | 319 | - name: Checkout Commit |
348 | 320 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
349 | | - - name: Restore Node dependencies cache |
350 | | - id: cache-node-modules |
351 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
352 | | - with: |
353 | | - path: | |
354 | | - node_modules |
355 | | - ~/.npm |
356 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
357 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
358 | | - - name: Install Node dependencies |
359 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
360 | | - run: npm install --ignore-scripts |
| 321 | + - name: Install and Cache Node Dependencies |
| 322 | + uses: ./.github/actions/install-and-cache-node-deps |
361 | 323 | - name: Build JS |
362 | 324 | run: npm run build:cjs |
363 | 325 | - name: Download napi artifacts |
@@ -452,18 +414,8 @@ jobs: |
452 | 414 | with: |
453 | 415 | node-version: ${{ matrix.node }} |
454 | 416 | check-latest: true |
455 | | - - name: Restore Node dependencies cache |
456 | | - id: cache-node-modules |
457 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
458 | | - with: |
459 | | - path: | |
460 | | - node_modules |
461 | | - ~/.npm |
462 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
463 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
464 | | - - name: Install Node dependencies |
465 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
466 | | - run: npm install --ignore-scripts |
| 417 | + - name: Install and Cache Node Dependencies |
| 418 | + uses: ./.github/actions/install-and-cache-node-deps |
467 | 419 | - name: Download napi artifacts |
468 | 420 | uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 |
469 | 421 | with: |
@@ -510,18 +462,8 @@ jobs: |
510 | 462 | with: |
511 | 463 | node-version: ${{ matrix.node }} |
512 | 464 | check-latest: true |
513 | | - - name: Restore Node dependencies cache |
514 | | - id: cache-node-modules |
515 | | - uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
516 | | - with: |
517 | | - path: | |
518 | | - node_modules |
519 | | - ~/.npm |
520 | | - key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} |
521 | | - restore-keys: node-modules-${{ runner.os }}-${{ runner.arch }} |
522 | | - - name: Install Node dependencies |
523 | | - if: steps.cache-node-modules.outputs.cache-hit != 'true' |
524 | | - run: npm install --ignore-scripts |
| 465 | + - name: Install and Cache Node Dependencies |
| 466 | + uses: ./.github/actions/install-and-cache-node-deps |
525 | 467 | - name: Download all artifacts |
526 | 468 | uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 |
527 | 469 | with: |
|
0 commit comments