From 6d8836e5f92003d11e98537746a4f8079ac1dace Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Wed, 15 Nov 2023 18:28:44 +0300 Subject: [PATCH] Parameterize the Go version used in the provider reusable workflows - Pass a --timeout=30m command-line argument to golangci-lint in provider CI Signed-off-by: Alper Rifat Ulucinar --- .github/workflows/provider-ci.yml | 17 +++++++++++------ .../provider-publish-service-artifacts.yml | 8 ++++++-- .github/workflows/provider-updoc.yml | 8 ++++++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/provider-ci.yml b/.github/workflows/provider-ci.yml index c3824c2..5f74d73 100644 --- a/.github/workflows/provider-ci.yml +++ b/.github/workflows/provider-ci.yml @@ -7,6 +7,11 @@ on: required: false type: boolean default: true + go-version: + description: 'Go version to use if building needs to be done' + default: '1.20' + required: false + type: string secrets: UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: required: true @@ -15,7 +20,6 @@ on: env: # Common versions - GO_VERSION: '1.20' GOLANGCI_VERSION: 'v1.54.2' DOCKER_BUILDX_VERSION: 'v0.8.2' @@ -78,7 +82,7 @@ jobs: - name: Setup Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ inputs.go-version }} - name: Find the Go Build Cache id: go_cache @@ -109,6 +113,7 @@ jobs: uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3 with: version: ${{ env.GOLANGCI_VERSION }} + args: --timeout=30m check-diff: runs-on: ubuntu-22.04 @@ -124,7 +129,7 @@ jobs: - name: Setup Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ inputs.go-version }} - name: Install goimports run: go install golang.org/x/tools/cmd/goimports @@ -193,7 +198,7 @@ jobs: - name: Setup Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ inputs.go-version }} - name: Find the Go Build Cache id: go_cache @@ -244,7 +249,7 @@ jobs: - name: Setup Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ inputs.go-version }} - name: Find the Go Build Cache id: go_cache @@ -308,7 +313,7 @@ jobs: - name: Setup Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ inputs.go-version }} - name: Find the Go Build Cache id: go_cache diff --git a/.github/workflows/provider-publish-service-artifacts.yml b/.github/workflows/provider-publish-service-artifacts.yml index 86242c5..499c32f 100644 --- a/.github/workflows/provider-publish-service-artifacts.yml +++ b/.github/workflows/provider-publish-service-artifacts.yml @@ -33,6 +33,11 @@ on: default: '' required: false type: string + go-version: + description: 'Go version to use if building needs to be done' + default: '1.20' + required: false + type: string secrets: UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: required: true @@ -41,7 +46,6 @@ on: env: # Common versions - GO_VERSION: '1.20' GOLANGCI_VERSION: 'v1.54.2' DOCKER_BUILDX_VERSION: 'v0.8.2' UP_VERSION: 'v0.17.0' @@ -100,7 +104,7 @@ jobs: - name: Setup Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ inputs.go-version }} - name: Find the Go Build Cache id: go_cache diff --git a/.github/workflows/provider-updoc.yml b/.github/workflows/provider-updoc.yml index 1dd5b9e..c6ecadc 100644 --- a/.github/workflows/provider-updoc.yml +++ b/.github/workflows/provider-updoc.yml @@ -8,12 +8,16 @@ on: default: 'monolith' required: false type: string + go-version: + description: 'Go version to use if building needs to be done' + default: '1.20' + required: false + type: string secrets: UPBOUND_CI_PROD_BUCKET_SA: required: true env: - GO_VERSION: "1.20" UPTEST_VERSION: "83bd901" jobs: @@ -28,7 +32,7 @@ jobs: - name: Setup Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ inputs.go-version }} - name: Find Go Caches id: go