-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
61 lines (59 loc) · 1.73 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: setup-pnpm
description: 🚙 reuse pnpm setup on CI over and over
inputs:
node-version:
description: Node.js version to use
required: false
default: current
pnpm-version:
description: pnpm version to use
required: false
default: 9
working-directory:
description: Specify where to run the install command
required: false
default: .
submodules:
description: Checkout also submodules
required: false
default: false
fetch-depth:
description: Fetch depth for actions/checkout
required: false
default: 1
install:
description: Installation script to run
required: false
default: pnpm i
build:
description: Build script to run
required: false
runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
submodules: ${{ inputs.submodules }}
fetch-depth: ${{ inputs.fetch-depth }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- uses: pnpm/action-setup@v4
with:
version: ${{ inputs.pnpm-version }}
package_json_file: ${{ inputs.working-directory }}/package.json
- run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
shell: bash
working-directory: ${{ inputs.working-directory }}
- uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- run: ${{ inputs.install }}
shell: bash
working-directory: ${{ inputs.working-directory }}
- run: ${{ inputs.build }}
if: ${{ inputs.build != '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}