Conversation
1.22 + 1.23 -> 1.23 + 1.24 Signed-off-by: Doug MacEachern <dougm@broadcom.com>
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.22 | ||
| go-version: 1.23 |
There was a problem hiding this comment.
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: falseNote, this also shows the recommended practive to pin the to release commit hash.
| key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go-1.22- | ||
| ${{ runner.os }}-go-1.23- |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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) }}
tenthirtyam
left a comment
There was a problem hiding this comment.
I added a few suggestions for:
- simplifing on-going maintenance for the
setup-goreferring togo.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.04toubuntu-24.04orubuntu-latest. The 20.04 runner image was deprecated on 2025-02-01 and will be fully unsupported by 2025-04-01. Reference
|
Resolved in the PRs that followed. |
1.22 + 1.23 -> 1.23 + 1.24