Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci: upgrade setup-js-env to use corepack #664

Merged
merged 2 commits into from
Feb 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions .github/actions/setup-js-env/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup Node and run npm ci'
description: 'run actions/setup-node and `npm ci`'
name: 'Setup Node and run pnpm i'
description: 'setup node env'
runs:
using: 'composite'
steps:
Expand All @@ -8,28 +8,20 @@ runs:
with:
node-version-file: '.node-version'

- run: corepack enable
- run: |
corepack enable
corepack prepare --activate
pnpm --version
shell: bash

- run: corepack prepare
shell: bash

- run: pnpm --version
shell: bash

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
name: install pnpm

- uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ~/.local/share/pnpm/store/
key: ${{ runner.os }}-1-node${{ inputs.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-1-node${{ inputs.node-version }}-

- name: Install Dependencies
run: pnpm install
run: pnpm install --frozen-lockfile
shell: bash