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

Add 1.16.x and 1.17.x to the build matrix #29

Merged
merged 4 commits into from Aug 18, 2021

Conversation

kishaningithub
Copy link
Contributor

No description provided.

Copy link
Member

@ChrisHines ChrisHines left a comment

Choose a reason for hiding this comment

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

Thanks for the new PR! It looks good, except it's missing a couple entries, see inline comment for more.

.github/workflows/test.yml Show resolved Hide resolved
Copy link
Member

@ChrisHines ChrisHines left a comment

Choose a reason for hiding this comment

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

It looks like all Go 1.16 configurations are failing with:

 go test ./...
  shell: /usr/bin/bash -e {0}
  env:
    GOROOT: /opt/hostedtoolcache/go/1.16.6/x64
    GOPATH: /home/runner/work/stack/stack
    GOFLAGS: 
go: go.mod file not found in current directory or any parent directory; see 'go help modules'

I suspect this is due to Go 1.16 defaulting GO111MODULE=on and the Github action script I have is running go test ./... in the wrong directory. It's running in some parent dir and not seeing the go.mod file. I think this works with earlier versions of Go because they would run in GOPATH mode and find the package in a subdirectory.

I think we need to specify the working-directory option for the last step of the test script as documented here: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun.

So the last step should look like:

      - name: Test
        env:
          GOPATH: "${{github.workspace}}"
          GOFLAGS: ${{ matrix.go-flags }}
        working-directory: "${{github.workspace}}/src/github.com/${{github.repository}}"
        run: go test ./...

This problem existed before this PR and is only revealed now due to changes in Go 1.16 behavior compared to previous releases.

@ChrisHines
Copy link
Member

@kishaningithub Do you plan to add the working directory configuration? If not, I can take over this PR if you want.

@kishaningithub
Copy link
Contributor Author

kishaningithub commented Aug 18, 2021

@ChrisHines Thanks a lot for your patience. Have added the working-directory explicitly as you requested and also have added the brand new go 1.17 version to the build matrix :-)

@kishaningithub kishaningithub changed the title Add 1.16.x to the build matrix Add 1.16.x and 1.17.x to the build matrix Aug 18, 2021
@ChrisHines
Copy link
Member

Awesome! Hopefully that's all we need. Kicking off the builds. We'll see how it goes.

@ChrisHines
Copy link
Member

OK, only the -trimpath builds fail, which is expected. So we're good to go. Thanks for the PR!

@ChrisHines ChrisHines merged commit c58b278 into go-stack:develop Aug 18, 2021
@kishaningithub kishaningithub deleted the patch-2 branch August 18, 2021 06:52
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

Successfully merging this pull request may close these issues.

None yet

2 participants