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

ci: add testing using go 1.18 #331

Merged
merged 1 commit into from Mar 19, 2022
Merged

ci: add testing using go 1.18 #331

merged 1 commit into from Mar 19, 2022

Conversation

miabbott
Copy link
Member

@miabbott miabbott commented Mar 16, 2022

Expanded the list of OS used to include mac + windows; flipped the
logic to exclude combinations of go + mac/windows we don't want to
test.

@miabbott
Copy link
Member Author

miabbott commented Mar 16, 2022

Looks like the setup-go action doesn't have 1.18 in the manifest and trying to use the upstream release is failing.

 Setup go stable version spec 1.18.x
Attempting to download 1.18.x...
matching 1.18.x...
Not found in manifest.  Falling back to download directly from Go
Install from dist
Acquiring go1.18 from https://storage.googleapis.com/golang/go1.18.linux-amd64.tar.gz
Extracting Go...
/usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/8d360106-5ac3-4e1b-a3d5-3bffcbae1421 -f /home/runner/work/_temp/3ecd1849-3fa3-4a23-bcdb-a3816b6526ba
Error: The operation was canceled.

I suppose we should just wait a while on this change; marking as WIP

@miabbott miabbott changed the title test: add testing using go 1.18 Draft: test: add testing using go 1.18 Mar 16, 2022
@miabbott miabbott changed the title Draft: test: add testing using go 1.18 [WIP] test: add testing using go 1.18 Mar 16, 2022
@miabbott miabbott changed the title [WIP] test: add testing using go 1.18 [WIP] ci: add testing using go 1.18 Mar 16, 2022
@miabbott
Copy link
Member Author

Looks like the setup-go action doesn't have 1.18 in the manifest and trying to use the upstream release is failing.

 Setup go stable version spec 1.18.x
Attempting to download 1.18.x...
matching 1.18.x...
Not found in manifest.  Falling back to download directly from Go
Install from dist
Acquiring go1.18 from https://storage.googleapis.com/golang/go1.18.linux-amd64.tar.gz
Extracting Go...
/usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/8d360106-5ac3-4e1b-a3d5-3bffcbae1421 -f /home/runner/work/_temp/3ecd1849-3fa3-4a23-bcdb-a3816b6526ba
Error: The operation was canceled.

I suppose we should just wait a while on this change; marking as WIP

Well, that wasn't correct (learning about GH Actions today)...

The original error was a syntax problem in the YAML and once a single job failed, the rest were canceled.

The new error looks more specific to the bump to 1.18

run golangci-lint
  Running [/home/runner/golangci-lint-1.42.0-linux-amd64/golangci-lint run --out-format=github-actions -E=gofmt --timeout=30m0s] in [] ...
  Error: undeclared name: `yaml` (typecheck)
  Error: "gopkg.in/yaml.v3" imported but not used (typecheck)
  Error: undeclared name: `yaml` (typecheck)
  Error: "gopkg.in/yaml.v3" imported but not used (typecheck)
  Error: undeclared name: `yaml` (typecheck)
  Error: "gopkg.in/yaml.v3" imported but not used (typecheck)
  Error: could not import github.com/coreos/butane/translate/tests/pkga (-: could not load export data: cannot import "github.com/coreos/butane/translate/tests/pkga" (unknown iexport format version 2), export data is newer version - update tool) (typecheck)
  Error: could not import github.com/coreos/butane/translate/tests/pkgb (-: could not load export data: cannot import "github.com/coreos/butane/translate/tests/pkgb" (unknown iexport format version 2), export data is newer version - update tool) (typecheck)
  Error: missing return (typecheck)
  
  Error: issues found
  Ran golangci-lint in 11979ms

@miabbott miabbott marked this pull request as draft March 16, 2022 14:02
@bgilbert
Copy link
Contributor

The original idea with the Mac/Windows tests was that it isn't worth the CI resources to test all Go versions.

@bgilbert
Copy link
Contributor

Also, probably worth updating golangci-lint to latest and seeing what that does.

@miabbott
Copy link
Member Author

It looks like golanglint isn't supporting 1.18 yet, so I suspect this PR will be stalled until that support lands - golangci/golangci-lint#2649

An alternative is to disable linting for 1.18 while we wait for the 1.18 support?

.github/workflows/go.yml Outdated Show resolved Hide resolved
.github/workflows/go.yml Outdated Show resolved Hide resolved
@miabbott miabbott force-pushed the 1.18 branch 2 times, most recently from 8db6f78 to af3cd14 Compare March 18, 2022 15:59
Add 1.18.x to the matrix for `ubuntu-latest` and bump Mac/Windows to
the same version.

Also use `v1.45.0` version of `golangci-lint` which adds support
for go 1.18
@miabbott miabbott changed the title [WIP] ci: add testing using go 1.18 ci: add testing using go 1.18 Mar 18, 2022
@miabbott miabbott marked this pull request as ready for review March 18, 2022 16:04
@miabbott
Copy link
Member Author

Serendipity happened with golangci/golangci-lint#2438 landing and https://github.com/golangci/golangci-lint/releases/tag/v1.45.0 getting cut, so we can use 1.18 and linting.

Copy link
Member

@sohankunkerkar sohankunkerkar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@bgilbert bgilbert left a comment

Choose a reason for hiding this comment

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

🎉

@bgilbert bgilbert merged commit 2c8f388 into coreos:main Mar 19, 2022
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

3 participants