Consider OS release for pnpm cache in GH workflows (#19973)

This commit is contained in:
Pascal Jufer
2023-10-10 10:27:50 +02:00
committed by GitHub
parent 615ddfc6c4
commit b6f7dcaa0b

View File

@@ -1,5 +1,5 @@
name: Prepare
description: Install and build the app
description: Install dependencies and build the platform
inputs:
build:
description: Build the production bundle of the platform
@@ -10,7 +10,7 @@ inputs:
required: false
runs:
using: 'composite'
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
@@ -24,19 +24,21 @@ runs:
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
- name: Get cache info
id: cache-info
shell: bash
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "os-release=$(node --eval 'console.log(os.release())')" >> $GITHUB_OUTPUT
echo "pnpm-cache-dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ steps.cache-info.outputs.pnpm-cache-dir }}
key:
${{ runner.os }}-${{ steps.cache-info.outputs.os-release }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-${{ steps.cache-info.outputs.os-release }}-pnpm-store-
- name: Install dependencies
shell: bash