mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
build: pnpm (#9806)
This commit is contained in:
42
packages/actions/src/pnpmCache/action.yml
Normal file
42
packages/actions/src/pnpmCache/action.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
name: 'pnpm install'
|
||||
description: 'Run pnpm install with cache enabled'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Set up swap space
|
||||
if: runner.os == 'Linux'
|
||||
uses: pierotofy/set-swap-space@v1.0
|
||||
with:
|
||||
swap-size-gb: 10
|
||||
|
||||
- uses: pnpm/action-setup@v2.2.4
|
||||
name: Install pnpm
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
|
||||
id: pnpm-config
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache rotation keys
|
||||
id: cache-rotation
|
||||
shell: bash
|
||||
run: |
|
||||
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
pnpm install --frozen-lockfile --prefer-offline --loglevel error
|
||||
env:
|
||||
HUSKY: '0'
|
||||
Reference in New Issue
Block a user