-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
51 lines (51 loc) · 1.63 KB
/
action.yaml
File metadata and controls
51 lines (51 loc) · 1.63 KB
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
name: Setup environment
description: Setup GO or NPM environment
inputs:
enable_go:
description: Whether to enable go specific features, such as caching.
default: "false"
go_version:
description: The Go version to be used if Go is enable
default: 1.25.x
enable_go_cache:
description: Whether you want to cache the go dependencies
default: "true"
enable_cue:
description: Whether you want to install the cue binary
default: "false"
cue_version:
description: The Cue version to be used if Cue is enable
default: v0.14.1
enable_npm:
description: Whether to enable npm specific features, such as caching.
default: "false"
nvmrc_path:
description: Path to the nvmrc file that contain the node version
default: .nvmrc
runs:
using: composite
steps:
- name: Install Go
uses: actions/setup-go@v6
if: inputs.enable_go == 'true'
with:
go-version: ${{ inputs.go_version }}
cache: ${{ inputs.enable_go_cache }}
- name: Install Cue
if: ${{ inputs.enable_go == 'true' && inputs.enable_cue == 'true' }}
run: go install cuelang.org/go/cmd/cue@${{ inputs.cue_version }}
shell: bash
- name: Install nodejs
uses: actions/setup-node@v6
if: inputs.enable_npm == 'true'
with:
node-version-file: ${{ inputs.nvmrc_path }}
registry-url: "https://registry.npmjs.org"
- name: Cache npm
uses: actions/cache@v5.0.4
if: inputs.enable_npm == 'true'
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-