This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
generated from meshery/meshery-adapter-template
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from acald-creator/v1.19-upgrade
Upgrade to Go 1.19
- Loading branch information
Showing
21 changed files
with
434 additions
and
936 deletions.
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
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,4 +1,4 @@ | ||
name: Meshery-OSM | ||
name: Default Meshery OSM Workflow | ||
on: | ||
push: | ||
branches: | ||
|
@@ -16,40 +16,49 @@ jobs: | |
name: Check & Review code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
- uses: actions/setup-go@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
go-version: 1.19 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
go-version: '1.17' | ||
- run: GOPROXY=direct,https://proxy.golang.org GOSUMDB=off go install -mod=mod golang.org/x/lint/golint; go list ./osm/... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: v1.49 | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# args: --issues-exit-code=0 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
error_check: | ||
name: Error check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.17' | ||
go-version: '1.19' | ||
- run: GOPROXY=direct,https://proxy.golang.org GOSUMDB=off GO111MODULE=on go install -mod=mod github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -tags draft ./... | ||
error_code_check: | ||
name: Error code utility check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
go-version: 1.19 | ||
- run: | | ||
errWillHave="level=error" | ||
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go install github.com/layer5io/meshkit/cmd/errorutil; | ||
|
@@ -65,26 +74,29 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.17' | ||
- run: GOPROXY=direct,https://proxy.golang.org GOSUMDB=off GO111MODULE=on go install -mod=mod honnef.co/go/tools/cmd/staticcheck; /home/runner/go/bin/staticcheck -tags draft -checks all ./osm/... # https://staticcheck.io/docs/checks | ||
go-version: 1.19 | ||
- uses: dominikh/[email protected] | ||
with: | ||
install-go: false | ||
version: "2022.1" | ||
vet: | ||
name: Vet | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.17' | ||
go-version: '1.19' | ||
- run: GOPROXY=direct,https://proxy.golang.org GOSUMDB=off GO111MODULE=on go vet -tags draft ./... | ||
sec_check: | ||
name: Security check | ||
|
@@ -93,7 +105,7 @@ jobs: | |
GO111MODULE: on | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Run Gosec Security Scanner | ||
|
@@ -108,17 +120,17 @@ jobs: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.17' | ||
go-version: '1.19' | ||
- name: Create cluster using KinD | ||
uses: engineerd/setup-kind@v0.3.0 | ||
uses: engineerd/setup-kind@v0.5.0 | ||
with: | ||
version: "v0.7.0" | ||
version: "v0.11.0" | ||
- run: | | ||
export CURRENTCONTEXT="$(kubectl config current-context)" | ||
echo "current-context:" ${CURRENTCONTEXT} | ||
|
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
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
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
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
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,150 @@ | ||
linters-settings: | ||
depguard: | ||
list-type: blacklist | ||
packages: | ||
# logging is allowed only by logutils.Log, logrus | ||
# is allowed to use only in logutils package | ||
- github.com/sirupsen/logrus | ||
packages-with-error-message: | ||
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" | ||
dupl: | ||
threshold: 100 | ||
exhaustive: | ||
default-signifies-exhaustive: false | ||
funlen: | ||
lines: 100 | ||
statements: 50 | ||
gci: | ||
local-prefixes: github.com/golangci/golangci-lint | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 2 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- dupImport # https://github.com/go-critic/go-critic/issues/845 | ||
- ifElseChain | ||
- octalLiteral | ||
- whyNoLint | ||
- wrapperFunc | ||
gocyclo: | ||
min-complexity: 15 | ||
goimports: | ||
local-prefixes: github.com/golangci/golangci-lint | ||
golint: | ||
min-confidence: 0 | ||
gomnd: | ||
settings: | ||
mnd: | ||
# don't include the "operation" and "assign" | ||
checks: argument,case,condition,return | ||
gosec: | ||
settings: | ||
exclude: -G204 | ||
govet: | ||
check-shadowing: false | ||
settings: | ||
printf: | ||
funcs: | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf | ||
lll: | ||
line-length: 950 | ||
maligned: | ||
suggest-new: true | ||
misspell: | ||
locale: US | ||
nolintlint: | ||
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) | ||
allow-unused: false # report any unused nolint directives | ||
require-explanation: false # don't require an explanation for nolint directives | ||
require-specific: false # don't require nolint directives to be specific about which linter is being skipped | ||
|
||
linters: | ||
# please, do not use `enable-all`: it's deprecated and will be removed soon. | ||
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint | ||
disable-all: true | ||
enable: | ||
# todo[kushthedude]: commenting most of the checks as our code can't persist all of the changes, however we can plan further on code-quality after v1.0 release. | ||
# - bodyclose | ||
# - deadcode | ||
- dogsled | ||
- errcheck | ||
# - exhaustive | ||
# - funlen | ||
# - goconst | ||
# - gocritic | ||
# - gocyclo | ||
- gofmt | ||
- goimports | ||
# - golint | ||
# todo[kusthedude]: restore gosec check, once this issue is resolved https://github.com/golangci/golangci-lint/issues/177 | ||
# - gosec | ||
# - gomnd | ||
# - goprintffuncname | ||
# - gosimple | ||
- govet | ||
# - ineffassign | ||
# - interfacer | ||
- lll | ||
- misspell | ||
# - nakedret | ||
# - nolintlint | ||
# - rowserrcheck | ||
# - scopelint | ||
- staticcheck | ||
# - structcheck | ||
- stylecheck | ||
- typecheck | ||
# - unconvert | ||
# - unparam | ||
# - unused | ||
# - varcheck | ||
- whitespace | ||
|
||
# don't enable: | ||
# - asciicheck | ||
# - gochecknoglobals | ||
# - gocognit | ||
# - godot | ||
# - godox | ||
# - goerr113 | ||
# - maligned | ||
# - nestif | ||
# - prealloc | ||
# - testpackage | ||
# - wsl | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- gomnd | ||
|
||
# https://github.com/go-critic/go-critic/issues/926 | ||
- linters: | ||
- gocritic | ||
text: "unnecessaryDefer:" | ||
|
||
run: | ||
skip-dirs: | ||
- test/testdata_etc | ||
- internal/cache | ||
- internal/renameio | ||
- internal/robustio | ||
timeout: 5m | ||
|
||
# golangci.com configuration | ||
# https://github.com/golangci/golangci/wiki/Configuration | ||
service: | ||
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly | ||
prepare: | ||
- echo "here I can run custom commands, but no preparation needed for this repo" |
Oops, something went wrong.