forked from perses/perses
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use github composite action to simplify the flow (perses#584)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Showing
4 changed files
with
59 additions
and
70 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,37 @@ | ||
name: "Setup environment" | ||
description: "Setup GO or NPM environment" | ||
inputs: | ||
enable_go: | ||
description: Whether to enable go specific features, such as caching. | ||
default: "false" | ||
enable_npm: | ||
description: Whether to enable npm specific features, such as caching. | ||
default: "false" | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
if: inputs.enable_go == 'true' | ||
with: | ||
go-version: 1.19.x | ||
- uses: actions/cache@v3.0.8 | ||
if: inputs.enable_go == 'true' | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Install nodejs | ||
uses: actions/setup-node@v3 | ||
if: inputs.enable_npm == 'true' | ||
with: | ||
node-version-file: "ui/.nvmrc" | ||
registry-url: "https://registry.npmjs.org" | ||
- uses: actions/cache@v3.0.8 | ||
if: inputs.enable_npm == 'true' | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- |
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
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