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

Matrix testing with version from go.mod file #34

Open
Jacalz opened this issue Feb 23, 2024 · 0 comments
Open

Matrix testing with version from go.mod file #34

Jacalz opened this issue Feb 23, 2024 · 0 comments

Comments

@Jacalz
Copy link

Jacalz commented Feb 23, 2024

Similar to actions/setup-go#450, it would be nice to be able to specify go.mod (or any other path to a Go module) as an input to the go-version parameter. The benefit of this over go-version-file is that you can have a workflow with matrix testing using the version from go.mod as the lowest version and any newer versions. Basically, this makes it possible to write GitHub actions that are more or less maintenance free (the below example testing the lowest supported Go version and the latest stable):

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: WillAbides/setup-go-faster@v1
        with:
          go-version: ${{ matrix.go }}
      - run: go run hello.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant