2023-11-30 13:17:41 -07:00
|
|
|
name: Setup node_modules
|
|
|
|
description: Setup Node.js and install dependencies
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
working-directory:
|
|
|
|
description: 'working directory for yarn install'
|
|
|
|
default: ./
|
|
|
|
required: false
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18.x
|
|
|
|
|
|
|
|
- name: Cache dependencies
|
|
|
|
id: yarn-cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
2024-03-15 05:11:46 -06:00
|
|
|
${{ inputs.working-directory }}/node_modules
|
2023-11-30 13:17:41 -07:00
|
|
|
.yarn/install-state.gz
|
2024-03-15 05:11:46 -06:00
|
|
|
key: ${{ runner.os }}-yarn-${{ inputs.working-directory }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
|
2023-11-30 13:17:41 -07:00
|
|
|
restore-keys: |
|
2024-03-15 05:11:46 -06:00
|
|
|
${{ runner.os }}-yarn-${{ inputs.working-directory }}-${{ hashFiles('yarn.lock') }}-
|
|
|
|
${{ runner.os }}-yarn-${{ inputs.working-directory }}
|
2023-11-30 13:17:41 -07:00
|
|
|
- name: Install dependencies
|
|
|
|
working-directory: ${{ inputs.working-directory }}
|
|
|
|
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --immutable --ignore-scripts
|
|
|
|
shell: bash
|
2023-12-02 07:58:43 -07:00
|
|
|
|