keycloak-scim/.github/actions/pnpm-setup/action.yml
Alexander Schwartz 653f67768e
Aligning the JS build and caching with the main build (#31846)
Closes #31845

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
2024-08-13 09:05:29 +02:00

45 lines
1.2 KiB
YAML

name: Setup PNPM
description: Sets up Node.js and runs PNPM so dependencies are installed.
inputs:
node-version:
description: Node.js version
required: false
default: "20"
runs:
using: composite
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
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: |
echo "store-path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup PNPM cache
with:
# Also cache Cypress binary.
path: |
~/.cache/Cypress
${{ steps.pnpm-cache.outputs.store-path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
# Run the store prune after the installation to avoid having caches which grow over time
run: |
pnpm install --prefer-offline --frozen-lockfile
pnpm store prune