-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(monorepo): Update the setup action to correctly generate cache
- Loading branch information
1 parent
4965637
commit 97cb697
Showing
2 changed files
with
63 additions
and
13 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 |
---|---|---|
|
@@ -9,30 +9,80 @@ inputs: | |
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check pnpm version | ||
shell: bash | ||
id: pnpm | ||
run: | | ||
PNPM_VERSION=${PNPM_VERSION:-7.30.5} | ||
PKG_JSON=$(cat package.json | jq -r '.packageManager' | awk -F@ '{print $2}') | ||
if [ ! -z $PKG_JSON ]; then | ||
PNPM_VERSION=$PKG_JSON | ||
fi | ||
if [ ! -z pnpm ]; then | ||
PNPM_VERSION=9.10.0 | ||
fi | ||
echo "Using PNPM version $PNPM_VERSION" | ||
echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT | ||
- name: Setup PNPM | ||
id: pnpm_setup | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ steps.pnpm.outputs.version }} | ||
run_install: false | ||
package_json_file: ./package.json | ||
|
||
- name: Restore cached npm dependencies | ||
id: cache-dependencies-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache/Cypress # needed for the Cypress binary | ||
key: "dependencies-${{ hashFiles('pnpm-lock.yaml') }}" | ||
|
||
- name: Set up npm registry | ||
uses: actions/setup-node@v4 | ||
with: | ||
registry-url: https://registry.npmjs.org/ | ||
node-version-file: .github/.nvmrc | ||
cache: pnpm | ||
cache-dependency-path: pnpm-lock.yaml | ||
|
||
- uses: pnpm/[email protected] | ||
id: pnpm-install | ||
with: | ||
version: 8.10.2 | ||
version: 9.10.0 | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
id: pnpm-cache | ||
run: | | ||
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/setup-node@v4 | ||
with: | ||
registry-url: https://registry.npmjs.org | ||
node-version-file: .github/.nvmrc | ||
cache: pnpm | ||
cache-dependency-path: pnpm-lock.yaml | ||
|
||
- name: setup pnpm config registry | ||
run: pnpm config set registry https://registry.npmjs.org | ||
- name: Install pnpm package manager | ||
run: pnpm install --no-frozen-lockfile | ||
shell: bash | ||
|
||
- name: setup pnpm config registry | ||
run: pnpm install --no-frozen-lockfile | ||
- name: Setup pnpm config registry | ||
run: pnpm config set registry https://registry.npmjs.org | ||
shell: bash | ||
|
||
- name: Cache npm dependencies | ||
id: cache-dependencies-save | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache/Cypress # needed for the Cypress binary | ||
~/.cache/ | ||
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} | ||
|
||
- name: Configure git | ||
run: | | ||
git config user.name "Stormie-Bot" | ||
git config user.email "[email protected]" | ||
git config lfs.allowincompletepush true | ||
git config --global init.defaultBranch main | ||
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
shell: bash |
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