Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ on:
type: boolean
required: false
default: false
node-cache-dependency-path:
description: Used to specify the path to a dependency file - package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies (https://github.com/actions/setup-node#caching-global-packages-data)
type: string
required: false

# Playwright
run-playwright:
Expand Down Expand Up @@ -324,7 +328,7 @@ jobs:

ci:
name: CI
uses: grafana/plugin-ci-workflows/.github/workflows/ci.yml@main # zizmor: ignore[unpinned-uses]
uses: grafana/plugin-ci-workflows/.github/workflows/ci.yml@add-optional-node-caching # zizmor: ignore[unpinned-uses]
needs:
- setup
with:
Expand All @@ -334,6 +338,7 @@ jobs:
npm-registry-auth: ${{ inputs.npm-registry-auth }}
go-version: ${{ inputs.go-version }}
go-setup-caching: ${{ inputs.go-setup-caching }}
node-cache-dependency-path: ${{ inputs.node-cache-dependency-path }}
node-version: ${{ inputs.node-version }}
golangci-lint-version: ${{ inputs.golangci-lint-version }}
run-playwright: ${{ inputs.run-playwright }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
type: string
required: false
go-setup-caching:
description: Defines if setup-go action should have caching enabled (https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs)olangci-lint version to use
description: Defines if setup-go action should have caching enabled (https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs)
type: boolean
required: false
trufflehog-version:
Expand Down Expand Up @@ -62,6 +62,10 @@ on:
type: boolean
required: false
default: false
node-cache-dependency-path:
description: Used to specify the path to a dependency file - package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies (https://github.com/actions/setup-node#caching-global-packages-data)
type: string
required: false

# Playwright
run-playwright:
Expand Down Expand Up @@ -272,13 +276,15 @@ jobs:
return o

- name: Setup
uses: grafana/plugin-ci-workflows/actions/plugins/setup@main # zizmor: ignore[unpinned-uses]
uses: grafana/plugin-ci-workflows/actions/plugins/setup@add-optional-node-caching # zizmor: ignore[unpinned-uses]
with:
go-version: ${{ inputs.go-version || env.DEFAULT_GO_VERSION }}
node-version: ${{ inputs.node-version || env.DEFAULT_NODE_VERSION }}
node-version-file: ${{ inputs.plugin-directory }}/.nvmrc
golangci-lint-version: ${{ inputs.golangci-lint-version || env.DEFAULT_GOLANGCI_LINT_VERSION }}
go-setup-caching: ${{ inputs.go-setup-caching }}
node-cache: ${{ inputs.package-manager }}
node-cache-dependency-path: ${{ inputs.node-cache-dependency-path }}

- name: Get secrets from Vault
id: get-secrets
Expand Down
10 changes: 10 additions & 0 deletions actions/plugins/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ inputs:
description: Node.js version file to use.
required: false
default: ""
node-cache:
description: Used to specify a package manager for caching in the default directory. Supported values npm, yarn, pnpm (https://github.com/actions/setup-node#caching-global-packages-data)
required: false
default: ""
node-cache-dependency-path:
description: Used to specify the path to a dependency file - package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies (https://github.com/actions/setup-node#caching-global-packages-data)
required: false
default: ""

runs:
using: composite
Expand All @@ -28,6 +36,8 @@ runs:
with:
node-version: "${{ inputs.node-version }}"
node-version-file: "${{ inputs.node-version-file }}"
cache: "${{ inputs.node-cache }}"
Copy link
Contributor

@tolzhabayev tolzhabayev Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know what happens when those inputs are empty strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string is the default so it should work fine.

cache-dependency-path: "${{ inputs.node-cache-dependency-path }}"

- name: Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
Expand Down