2023-05-05 16:03:24 +00:00
|
|
|
name: Setup PNPM
|
|
|
|
description: Sets up Node.js and runs PNPM so dependencies are installed.
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
node-version:
|
|
|
|
description: Node.js version
|
|
|
|
required: false
|
2024-04-02 14:14:58 +00:00
|
|
|
default: "20"
|
2023-05-05 16:03:24 +00:00
|
|
|
|
|
|
|
working-directory:
|
|
|
|
description: The working directory where the `pnpm-lock.yaml` file is located.
|
|
|
|
required: false
|
|
|
|
default: ""
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
- name: Set up Node.js
|
2024-03-22 07:57:41 +00:00
|
|
|
uses: actions/setup-node@v4
|
2023-05-05 16:03:24 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ inputs.node-version }}
|
|
|
|
check-latest: true
|
|
|
|
|
|
|
|
- name: Enable Corepack
|
|
|
|
shell: bash
|
|
|
|
run: corepack enable
|
|
|
|
|
|
|
|
- name: Get PNPM store directory
|
|
|
|
id: pnpm-cache
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-10-30 11:50:06 +00:00
|
|
|
echo "store-path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
|
2023-05-05 16:03:24 +00:00
|
|
|
|
2024-03-22 07:57:41 +00:00
|
|
|
- uses: actions/cache@v4
|
2023-05-05 16:03:24 +00:00
|
|
|
name: Setup PNPM cache
|
|
|
|
with:
|
|
|
|
# Also cache Cypress binary.
|
|
|
|
path: |
|
|
|
|
~/.cache/Cypress
|
|
|
|
${{ steps.pnpm-cache.outputs.store-path }}
|
|
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('${{ inputs.working-directory }}/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
working-directory: ${{ inputs.working-directory }}
|
|
|
|
shell: bash
|
2023-10-30 11:50:06 +00:00
|
|
|
run: pnpm install --prefer-offline --frozen-lockfile
|