-
Notifications
You must be signed in to change notification settings - Fork 38
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
update to go 1.17 as minimum, fix and update actions #30
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,77 @@ | ||
name: Test | ||
on: [push, pull_request] | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
|
||
jobs: | ||
test: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
timeout-minutes: 10 | ||
|
||
strategy: | ||
matrix: | ||
go-versions: [1.12.x, 1.13.x, 1.14.x] | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
# test against the "oldest" supported version and the current version | ||
# of go. Go 1.17 is kept in this matrix as it is the minimum version | ||
# specified in go.mod, and maintaining compatibility with go 1.17 is | ||
# currently not much of a burden. Most projects using this module are | ||
# using newer versions than that, so we can drop the old version if | ||
# it becomes too much of a burden. | ||
go-version: [1.17.x, 1.19.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: go mod tidy | ||
run: | | ||
go mod tidy | ||
git diff --exit-code | ||
- name: Ensure IPVS module | ||
run: sudo modprobe ip_vs | ||
run: | | ||
sudo modprobe ip_vs | ||
- name: Test | ||
run: sudo go test -v ./... | ||
run: | | ||
go test -exec "sudo -n" -v ./... | ||
lint: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
uses: actions/setup-go@v3 | ||
with: | ||
# We only run on the latest version of go, as some linters may be | ||
# version-dependent (for example gofmt can change between releases). | ||
go-version: 1.19.x | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Lint | ||
run: | | ||
docker run --rm -v `pwd`:/go/src/github.com/moby/ipvs -w /go/src/github.com/moby/ipvs \ | ||
golangci/golangci-lint:v1.23.8 golangci-lint run --disable-all -v \ | ||
-E govet -E misspell -E gofmt -E ineffassign -E golint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: "v1.50.1" | ||
skip-cache: true | ||
args: --print-resources-usage --timeout=5m --verbose | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | ||
# skip-pkg-cache: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | ||
# skip-build-cache: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- gofmt | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- revive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
module github.com/moby/ipvs | ||
|
||
go 1.13 | ||
go 1.17 | ||
|
||
require ( | ||
github.com/sirupsen/logrus v1.4.2 | ||
github.com/vishvananda/netlink v1.1.0 | ||
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df | ||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 | ||
) | ||
|
||
require github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this indirect should go away if we update the minimum logrus version |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a need for the multiline string syntax when we only have one line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, I made the change as I was syncing with other repositories (made it easier to compare).
Happy to revert if you prefer though (let me know)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That justification makes sense; ultimately using composite actions among the repos that are very similar (e.g. these small modules) is probably something we should explore.