From 3dfb5bc0fedfcf1f826aea713e425ad4a8601d0f Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Thu, 11 Jan 2024 16:00:23 +0100 Subject: [PATCH] bump actions/setup go and add a new input to activate the cache on demand Signed-off-by: Augustin Husson --- action.yaml | 2 +- actions/setup_environment/action.yaml | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/action.yaml b/action.yaml index 2d47447..6ec6f83 100644 --- a/action.yaml +++ b/action.yaml @@ -3,7 +3,7 @@ description: An action used by the Perses project to share github actions. runs: using: composite steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: 'perses/github-actions' path: '.github/perses-ci' \ No newline at end of file diff --git a/actions/setup_environment/action.yaml b/actions/setup_environment/action.yaml index feb2c34..fce1e3d 100644 --- a/actions/setup_environment/action.yaml +++ b/actions/setup_environment/action.yaml @@ -4,6 +4,9 @@ inputs: enable_go: description: Whether to enable go specific features, such as caching. default: "false" + enable_go_cache: + description: Wether you want to cache the go dependencies + default: "true" enable_npm: description: Whether to enable npm specific features, such as caching. default: "false" @@ -11,17 +14,11 @@ runs: using: composite steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 if: inputs.enable_go == 'true' with: go-version: 1.21.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- + cache: ${{ inputs.enable_go_cache }} - name: Install nodejs uses: actions/setup-node@v3 if: inputs.enable_npm == 'true'