Skip to content

Commit

Permalink
Use go version from go.mod files in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario committed Nov 22, 2024
1 parent 0660bb6 commit ac3e0d3
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 67 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,10 @@ on:
- master
- 'release-v**'
env:
GO_VERSION: "1.22"
PRIORITIES: "P0"
jobs:
unpack-envvars:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.step.outputs.go-version }}
steps:
- id: step
run: |
echo "go-version=${{ env.GO_VERSION }}" >> $GITHUB_OUTPUT
lint:
name: Lint
needs:
- unpack-envvars
strategy:
fail-fast: false
matrix:
Expand All @@ -42,11 +30,8 @@ jobs:
uses: ./.github/workflows/lint.yml
with:
component: ${{ matrix.component }}
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
unit-tests:
name: Unit Tests
needs:
- unpack-envvars
strategy:
fail-fast: false
matrix:
Expand All @@ -61,7 +46,6 @@ jobs:
uses: ./.github/workflows/unit-tests.yml
with:
component: ${{ matrix.component }}
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -77,7 +61,6 @@ jobs:
name: Integration Test
needs:
- flyteadmin-int-tests-image-build
- unpack-envvars
strategy:
fail-fast: false
matrix:
Expand All @@ -87,12 +70,9 @@ jobs:
with:
component: ${{ matrix.component }}
cache_key: ${{ needs.flyteadmin-int-tests-image-build.outputs.cache_key }}
go-version: ${{ needs.unpack-envvars.outputs.go-version }}

generate:
name: Check Go Generate
needs:
- unpack-envvars
strategy:
fail-fast: false
matrix:
Expand All @@ -105,7 +85,6 @@ jobs:
uses: ./.github/workflows/go_generate.yml
with:
component: ${{ matrix.component }}
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}

Expand All @@ -121,16 +100,14 @@ jobs:
dry_run_goreleaser:
name: Dry Run Goreleaser
runs-on: ubuntu-latest
needs:
- unpack-envvars
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
go-version-file: go.mod
- name: Run GoReleaser dry run
uses: goreleaser/goreleaser-action@v5
with:
Expand All @@ -146,8 +123,6 @@ jobs:
defaults:
run:
working-directory: flytectl
needs:
- unpack-envvars
steps:
- uses: insightsengineering/disk-space-reclaimer@v1
- name: Checkout
Expand All @@ -161,7 +136,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
go-version-file: go.mod
- name: Build Flytectl binary
run: make compile
- name: Create a sandbox cluster
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flytectl-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
go-version-file: flytectl/go.mod
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/flyteidl-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,27 @@ on:
branches:
- master
- 'release-v**'
env:
GO_VERSION: "1.22"
jobs:
unpack-envvars:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.step.outputs.go-version }}
steps:
- id: step
run: |
echo "go-version=${{ env.GO_VERSION }}" >> $GITHUB_OUTPUT
lint:
name: Lint
needs:
- unpack-envvars
strategy:
fail-fast: false
uses: ./.github/workflows/lint.yml
with:
component: flyteidl
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
unit-tests:
name: Unit Tests
needs:
- unpack-envvars
uses: ./.github/workflows/unit-tests.yml
with:
component: flyteidl
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
generate:
name: Check Go Generate
needs:
- unpack-envvars
strategy:
fail-fast: false
uses: ./.github/workflows/go_generate.yml
with:
component: flyteidl
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/generate_flyte_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: "0"
- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version-file: go.mod
- name: Update references
env:
VERSION: ${{ github.event.inputs.next-version }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/go_generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
component:
required: true
type: string
go-version:
required: true
type: string
secrets:
FLYTE_BOT_PAT:
required: true
Expand All @@ -29,6 +26,6 @@ jobs:
github_token: ${{ secrets.FLYTE_BOT_PAT }}
- uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
go-version-file: ${{ inputs.component }}/go.mod
- name: Go generate and diff
run: DELTA_CHECK=true make generate
5 changes: 1 addition & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
description: "Cache key for docker image"
required: true
type: string
go-version:
required: true
type: string
jobs:
integration:
name: Integration tests
Expand All @@ -39,7 +36,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
go-version-file: ${{ inputs.component }}/go.mod
- name: Integration
run: |
# attempt to clean up some unneeded data: https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
component:
required: true
type: string
go-version:
required: true
type: string
jobs:
lint:
name: Run Lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/single-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version-file: go.mod
- name: Compile
run: make compile
- name: Run tests
Expand Down Expand Up @@ -83,6 +83,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version-file: go.mod
- name: Helm and diff
run: DELTA_CHECK=true make helm
5 changes: 1 addition & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
component:
required: true
type: string
go-version:
required: true
type: string
secrets:
CODECOV_TOKEN:
required: true
Expand All @@ -25,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
go-version-file: ${{ inputs.component }}/go.mod
- name: Unit Tests
run: make install && make test_unit_codecov
- name: Push CodeCov
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/flyteorg/flyte/flyteadmin

go 1.23
go 1.22

require (
cloud.google.com/go/iam v1.1.5
Expand Down

0 comments on commit ac3e0d3

Please sign in to comment.