-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
43 lines (43 loc) · 1.24 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
name: Install tools from asdf config
description: Install runtimes by asdf CLI with a cache
author: Andrey Sitnik
branding:
icon: download
color: purple
inputs:
dependencies-cache:
description: Postfix for pnpm cache name
default: "default"
runs:
using: "composite"
steps:
- name: Install asdf
uses: asdf-vm/actions/setup@v3
- name: Cache asdf
id: cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: asdf-${{ hashFiles('**/.tool-versions') }}
- name: Install asdf tools
if: steps.cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v3
- name: Check pnpm
id: pnpm
shell: bash
run: |
if grep --quiet "^pnpm " .tool-versions; then
echo "detected=true" >> $GITHUB_OUTPUT
fi
- name: Get pnpm store directory
if: steps.pnpm.outputs.detected == 'true'
id: pnpm-cache
shell: bash
run: |
echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm modules
if: steps.pnpm.outputs.detected == 'true'
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.path }}
key: pnpm-${{ inputs.dependencies-cache }}-${{ hashFiles('pnpm-lock.yaml') }}