Skip to content

Commit

Permalink
Move setup go to separate action (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKalke authored May 6, 2024
1 parent 38328a0 commit 07bb1d4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 42 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup-go/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Setup go'
description: 'Action for the go setup'

runs:
using: 'composite'
steps:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '1.22'
7 changes: 1 addition & 6 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: "Create release"

env:
SETUP_GO_VERSION: '1.22'

on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -78,9 +75,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.ref_name }} # checkout to latest branch changes ( by default this action checkouts to the SHA that triggers action )

- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go

- name: Create changelog
env:
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/operator-verify.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Operator verify

env:
SETUP_GO_VERSION: '1.22'

on:
push:
branches: [ "main", "release-*" ]
Expand All @@ -23,9 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- uses: golangci/golangci-lint-action@v3
with:
version: latest
Expand All @@ -36,9 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- name: run test
run: make -C components/operator test

Expand All @@ -47,9 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- name: create single cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down Expand Up @@ -83,9 +74,7 @@ jobs:
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- name: create single cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down Expand Up @@ -113,9 +102,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- name: save sa
shell: bash
run: 'echo "$GARDENER_SA" > /tmp/gardener-sa.yaml'
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/serverless-verify.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Serverless verify

env:
SETUP_GO_VERSION: '1.22'

on:
push:
branches: [ "main", "release-*" ]
Expand All @@ -23,9 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -37,9 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- name: run test
run: make -C components/serverless test
Expand All @@ -49,9 +42,7 @@ jobs:
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- name: create single cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down Expand Up @@ -84,9 +75,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- name: create single cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand All @@ -113,9 +102,7 @@ jobs:
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-go
- name: create single cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down

0 comments on commit 07bb1d4

Please sign in to comment.