name: Yarn install description: "Install all NPM dependencies, caches them and restores if necessary" inputs: node_version: required: true description: "The node version used to run this" runs: using: "composite" steps: - uses: actions/setup-node@v3 with: node-version: ${{ inputs.node_version }} - name: node_modules cache id: node-modules-cache uses: actions/cache@v3 env: cache-name: node-modules-yarn cache-key: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }} with: path: node_modules key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.cache-key }} restore-keys: ${{ runner.os }}-${{ env.cache-name }}- - name: Yarn install shell: bash if: steps.node-modules-cache.outputs.cache-hit != 'true' run: yarn install --prefer-offline --frozen-lockfile