-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): split Node.js setup into separate composite action
- Loading branch information
Showing
3 changed files
with
52 additions
and
24 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: 'Setup (Node.js)' | ||
|
||
description: 'Setup Node.js and pnpm' | ||
|
||
inputs: | ||
node-version: | ||
description: 'The Node.js version to use' | ||
required: true | ||
default: 'lts' | ||
pnpm-version: | ||
description: 'The pnpm version to use' | ||
required: true | ||
default: 'latest' | ||
|
||
runs: | ||
# Read about composite actions in: | ||
# https://docs.github.com/en/actions/sharing-automations/avoiding-duplication. | ||
# | ||
# Composite actions cannot use secrets, and are logged as a single step. | ||
using: 'composite' | ||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: ${{ inputs.pnpm-version }} | ||
run_install: false | ||
standalone: true | ||
dest: ~/setup-pnpm | ||
|
||
- name: Cache pnpm modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-${{ matrix.node }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.node }}-node- | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
20.9.0 | ||
20.17.0 |