Skip to content

How to run tests with latest golang version #455

@fredmaggiowski

Description

@fredmaggiowski

Description:

Hi, I can't find a way to make my action run against the latest golang version available.

I want to run tests against stable golang releases but also verify that newer golang version do not provide harm to my codebase, for this reason I've setup my action to run on a version matrix and then have a "special job" that I want to run tests on the very latest golang release.

This is my setup:

      - name: Use golang ${{ matrix.go_version }}
        uses: actions/setup-go@v5
        with:
          check-latest: true

What I'd expect from this is that used golang version would be something > go1.22, instead I see golang 1.20 is being used.

Even adding cache: false makes my action run with golang 1.20

I understand this might not be a bug but just me not understanding the doc, but how am I supposed to reach my goal?

Action version:

actions/setup-go@v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Repro steps:

Action current configuration on main branch:

https://github.com/rond-authz/rond/blob/07099709a5968c4617c9342716b64d9e077b38f7/.github/workflows/test.yml#L53-L55

PR where I'm trying to fix the behavior:

https://github.com/rond-authz/rond/pull/320/files

Action result showing golang 1.20 is being used:

https://github.com/rond-authz/rond/actions/runs/7816281593/job/21321451154?pr=320#step:3:9

Screenshot 2024-02-07 alle 15 33 02

Expected behavior:

My test-latest job should run with the latest golang release avilable

Actual behavior:

not the latest is being used, regardless of the cache (apparently)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions