Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use go version from go.mod files in CI #5736

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 1 addition & 4 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 All @@ -22,6 +19,6 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
go-version-file: ${{ inputs.component }}/go.mod
- name: Lint
run: make install && make lint
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
Loading