Skip to content

Commit

Permalink
ci: use go version in go.mod file
Browse files Browse the repository at this point in the history
And drop use of .github/env.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
  • Loading branch information
jan--f committed Sep 1, 2023
1 parent 39ebd6c commit 5b1271f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 55 deletions.
5 changes: 1 addition & 4 deletions .github/e2e-tests-olm/action.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: e2e-tests-olm
description: Runs E2E tests against the OLM bundle
inputs:
go-version:
description: "go version"
required: true
kind-version:
description: "kind version"
required: false
Expand All @@ -18,7 +15,7 @@ runs:
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand Down
1 change: 0 additions & 1 deletion .github/env

This file was deleted.

5 changes: 1 addition & 4 deletions .github/olm-publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ inputs:
quay_token:
description: "Quay token"
required: true
go-version:
description: "go version"
required: true
runs:
using: composite
steps:
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand Down
5 changes: 1 addition & 4 deletions .github/package-operator-publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ inputs:
quay_token:
description: "Quay token"
required: true
go-version:
description: "go version"
required: true
runs:
using: composite
steps:
Expand All @@ -20,7 +17,7 @@ runs:
- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand Down
25 changes: 4 additions & 21 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

- uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand All @@ -54,12 +51,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

- uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand All @@ -73,12 +67,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

- uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand All @@ -92,13 +83,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand All @@ -113,10 +101,5 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

- name: e2e tests through OLM
uses: ./.github/e2e-tests-olm
with:
go-version: ${{ env.go-version }}
24 changes: 3 additions & 21 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

- name: e2e tests through OLM
uses: ./.github/e2e-tests-olm
with:
go-version: ${{ env.go-version }}

publish-olm-development:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
Expand All @@ -29,17 +24,14 @@ jobs:
with:
fetch-depth: 0

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

# Bumping the version in the next step will also run code generation scripts
# that depend on controller-gen.
# Therefore, we first need to setup Go so that we can install the
# controller-gen binary.
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand All @@ -60,7 +52,6 @@ jobs:
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}

- name: Push catalog index changes
uses: ad-m/github-push-action@master
Expand All @@ -76,7 +67,6 @@ jobs:
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}

create-github-prerelease:
needs:
Expand All @@ -90,17 +80,14 @@ jobs:
fetch-depth: 0
token: ${{ secrets.REPOSITORY_PUSH_TOKEN }}

- name: Import common environment variables
run: cat ".github/env" >> $GITHUB_ENV

# Bumping the version in the next step will also run code generation scripts
# that depend on controller-gen.
# Therefore, we first need to setup Go so that we can install the
# controller-gen binary.
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand Down Expand Up @@ -141,13 +128,10 @@ jobs:
fetch-depth: 0
token: ${{ secrets.REPOSITORY_PUSH_TOKEN }}

- name: Import common environment variables
run: cat ".github/env" >> "$GITHUB_ENV"

- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: ${{ env.go-version }}
go-version-file: 'go.mod'
check-latest: true
cache: true

Expand All @@ -168,7 +152,6 @@ jobs:
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}

- name: Push catalog index changes
uses: ad-m/github-push-action@master
Expand All @@ -184,4 +167,3 @@ jobs:
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
go-version: ${{ env.go-version }}

0 comments on commit 5b1271f

Please sign in to comment.