-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31e0032
commit a5fae23
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'Monorepo install (pnpm)' | ||
description: 'Run pnpm install' | ||
|
||
runs: | ||
using: 'composite' | ||
|
||
steps: | ||
- uses: pnpm/action-setup@v2.2.4 | ||
with: | ||
version: 8.4.0 | ||
|
||
- name: Expose pnpm config(s) through "$GITHUB_OUTPUT" | ||
id: pnpm-config | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path | tr -d '\n')" >> $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 }}- | ||
# Prevent store to grow over time (not needed with yarn) | ||
# Note: not perfect as it prune too much in monorepos so the idea | ||
# is to use cache-rotation as above. In the future this might work better. | ||
#- name: Prune pnpm store | ||
# shell: bash | ||
# run: pnpm prune store | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install --frozen-lockfile --prefer-offline | ||
env: | ||
# Other environment variables | ||
HUSKY: '0' # By default do not run HUSKY install |