-
Couldn't load subscription status.
- Fork 610
Description
Description:
Describe your proposal.
I want to be able to do something like this where the used Go versions are set automatically in matrix testing without having to manually maintain the workflows. This is very useful when having many repositories with CI/CD infrastructure set up. To minimize the versions of Go used for testing, I want to test with the latest stable and the minimum version that the project supports, i.e. I want to use stable and the version from my go.mod file.
My idea is to be able to specify something like go-version-file inside the go-version field:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ 'go.mod', 'stable' ]
name: Go ${{ matrix.go }} sample
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- run: go run hello.goJustification:
Justification or a use case for your proposal.
This is very useful when having many repositories with CI/CD infrastructure set up. To minimize the versions of Go used for testing, I want to test with the latest stable and the minimum version that the project supports, i.e. I want to use stable and the version from my go.mod file.
Are you willing to submit a PR?
Sorry. I'll let you handle this
Activity
aparnajyothi-y commentedon Jan 10, 2024
Hello @Jacalz,
Thank you for creating this issue, we will investigate it and come back to you as soon as we have some feedback.
go-versionto accept go.mod files #489ardnew commentedon Aug 15, 2024
You can achieve this using a secondary job in your workflow to construct the build matrix for your actual build job. I just worked through this myself:
Load minimum Go version from go.mod
Load version from go.mod automatically