Skip to content

Commit

Permalink
[chore] use Go version of go.mod in GitHub actions (#797)
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
  • Loading branch information
andreasgerstmayr committed Feb 14, 2024
1 parent 5096097 commit 97ccaaa
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 37 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ jobs:
!contains(github.event.pull_request.title, 'Prepare release')
steps:
- name: Checkout Repo
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version-file: go.mod

- name: Ensure no changes to the CHANGELOG
run: |
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
name: Unit tests
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Check out code into the Go module directory
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: "basic checks"
run: make ci

Expand All @@ -41,7 +41,7 @@ jobs:
name: Security
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
Expand All @@ -59,15 +59,16 @@ jobs:
name: Code standards (linting)
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: go.mod

- name: Lint
uses: golangci/golangci-lint-action@v4
with:
args: -v
version: v1.52.2
version: v1.56.1
20 changes: 10 additions & 10 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
- "1.28"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: go.mod

- name: "install kuttl"
run: ./hack/install/install-kuttl.sh
Expand All @@ -49,16 +49,16 @@ jobs:
- "1.28"

steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Check out code into the Go module directory
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Start kind
run: kind create cluster --config kind-${{ matrix.kube-version }}.yaml --wait 5m

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ jobs:
prepare-release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- uses: actions/checkout@v4
go-version-file: go.mod

- name: Update makefile
run: sed -i.bak "s/OPERATOR_VERSION ?= .*/OPERATOR_VERSION ?= $OPERATOR_VERSION/g" Makefile && rm Makefile.bak
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-test-utils-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ jobs:
env:
BRANCH: ${{ github.event.pull_request.head.ref }}

- name: Set up Go
uses: actions/setup-go@v5
- name: Checkout
uses: actions/checkout@v4
with:
go-version: "1.20"
ref: main

- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
ref: main
go-version-file: go.mod

- name: "generate release resources"
run: make release-artifacts
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/reusable-publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
name: Publish container images
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Unshallow
run: git fetch --prune --unshallow
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- "1.28"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: go.mod

- name: "install kuttl"
run: ./hack/install/install-kuttl.sh
Expand Down

0 comments on commit 97ccaaa

Please sign in to comment.