Skip to content

chore: bump Go versions#3708

Closed
dougm wants to merge 1 commit intovmware:mainfrom
dougm:go-versions
Closed

chore: bump Go versions#3708
dougm wants to merge 1 commit intovmware:mainfrom
dougm:go-versions

Conversation

@dougm
Copy link
Copy Markdown
Member

@dougm dougm commented Mar 14, 2025

1.22 + 1.23 -> 1.23 + 1.24

1.22 + 1.23 -> 1.23 + 1.24

Signed-off-by: Doug MacEachern <dougm@broadcom.com>
Comment on lines 46 to +49
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you consider simply refereceing go.mod to simplify the maintenance?

      - name: Setup Go
        uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
        with:
          go-version-file: "go.mod"
          cache: false

Note, this also shows the recommended practive to pin the to release commit hash.

Comment on lines +57 to +59
key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-1.22-
${{ runner.os }}-go-1.23-
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d4323d4

You should be able to use the following to simply and reduce maintenance:

      - name: Restore Go cache
        uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
        with:
          path: |
            ~/.cache/go-build
            ~/go/pkg/mod
          key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-

strategy:
matrix:
go-version: ["1.22", "1.23"]
go-version: ["1.23", "1.24"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could define this as a variable for the repo to avoid simplify updates.

go-version: ${{ fromJson(vars.GO_VERSION_MATRIX) }}

fail-fast: false
matrix:
go-version: ["1.22"]
go-version: ["1.23"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could define this as a variable for the repo to avoid simplify updates.

go-version: ${{ fromJson(vars.GO_VERSION_MATRIX) }}

or

if just one...

go-version: ${{ fromJson(vars.GO_VERSION) }}

Copy link
Copy Markdown
Contributor

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few suggestions for:

  • simplifing on-going maintenance for the setup-go referring to go.mod.
  • simplifing referencing the go testing matrix using a variable in the repo.

Also, you may wish to consider the below for a seperate PR:

  • Update actions to refer to the release commit hash.

    Example: uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0

  • And especially updating the use of all offurances of ubuntu-20.04 to ubuntu-24.04 or ubuntu-latest. The 20.04 runner image was deprecated on 2025-02-01 and will be fully unsupported by 2025-04-01. Reference

@tenthirtyam
Copy link
Copy Markdown
Contributor

Resolved in the PRs that followed.

@vmware vmware locked as resolved and limited conversation to collaborators Mar 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants