mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
ci: properly cache yarn deps
This commit is contained in:
35
packages/actions/src/yarnCache/action.yml
Normal file
35
packages/actions/src/yarnCache/action.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
name: 'yarn install'
|
||||
description: 'Run yarn install with node_modules linker and cache enabled'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Expose yarn config as "$GITHUB_OUTPUT"
|
||||
id: yarn-config
|
||||
shell: bash
|
||||
run: |
|
||||
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Restore yarn cache
|
||||
uses: actions/cache@v3
|
||||
id: yarn-download-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
|
||||
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-download-cache-
|
||||
|
||||
- name: Restore yarn install state
|
||||
id: yarn-install-state-cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .yarn/ci-cache/
|
||||
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
yarn install --immutable --inline-builds
|
||||
env:
|
||||
YARN_ENABLE_GLOBAL_CACHE: 'false'
|
||||
YARN_NM_MODE: 'hardlinks-local'
|
||||
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz
|
||||
Reference in New Issue
Block a user