generated from meshery/meshery-istio
-
Notifications
You must be signed in to change notification settings - Fork 33
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] Update CI workflows #127
Open
acald-creator
wants to merge
8
commits into
meshery:master
Choose a base branch
from
nebula-aac:update-workflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5cbe503
Update workflows, and make changes recommended
acald-creator b34c7e4
Fix workflow
acald-creator 974551d
Increase timeout
acald-creator d023953
Merge branch 'meshery:master' into update-workflow
acald-creator 96aa45b
Merge branch 'master' into update-workflow
acald-creator 9e5e181
Merge branch 'master' into update-workflow
acald-creator 79cc904
Updated workflow. Updated go.mod
acald-creator ae1a932
Merge branch 'meshery:master' into update-workflow
acald-creator 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 was deleted.
Oops, something went wrong.
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,35 @@ | ||
name: Test Meshery-App Mesh Workflow | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
tests: | ||
name: Tests | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@main | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@main | ||
with: | ||
go-version: 1.19 | ||
check-latest: true | ||
cache: true | ||
- name: Create cluster using KinD | ||
uses: helm/[email protected] | ||
- run: | | ||
export CURRENTCONTEXT="$(kubectl config current-context)" | ||
echo "current-context:" ${CURRENTCONTEXT} | ||
export KUBECONFIG="${HOME}/.kube/config" | ||
echo "environment-kubeconfig:" ${KUBECONFIG} | ||
GOPROXY=direct GOSUMDB=off GO111MODULE=on go test ./... |
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,32 @@ | ||
name: Golangci-Lint CI Workflow | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: | ||
- master | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
golangci: | ||
strategy: | ||
matrix: | ||
go: [1.19] | ||
os: [ubuntu-latest, windows-latest] | ||
name: golangci-lint | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
check-latest: true | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: --timeout 5m --verbose |
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,144 @@ | ||
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 | ||
# https://golangci-lint.run/usage/linters/ | ||
disable-all: true | ||
enable: | ||
# TODO: consider continuously if more should be enabled. | ||
# Can also be useful to run with more strict settings before commit locally, i.e. to test for TODOs (godox) | ||
# - bodyclose | ||
# - deadcode | ||
- dogsled | ||
# - dupl | ||
- errcheck | ||
# - exhaustive | ||
# - funlen | ||
# - goconst | ||
# - gocritic | ||
# - gocyclo | ||
- gofmt | ||
- goimports | ||
# - golint | ||
- gomodguard | ||
- gosec | ||
# - gomnd | ||
# - goprintffuncname | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
# - interfacer | ||
- lll | ||
- misspell | ||
# - nakedret | ||
# - nolintlint | ||
# - rowserrcheck | ||
# - scopelint | ||
- staticcheck | ||
# - structcheck | ||
- stylecheck | ||
- typecheck | ||
# - unconvert | ||
# - unparam | ||
- unused | ||
# - varcheck | ||
- whitespace | ||
- 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 |
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
Oops, something went wrong.
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.
@acald-creator Why does running the unit tests require a kind cluster?
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.
@Revolyssup From the original file at https://github.com/meshery/meshery-app-mesh/blob/master/.github/workflows/ci.yml this is already there. The only difference I did was removed the other checks such as errcheck, vet and gosec because golangci-lint already does this.
This is the same test done through all the adapters repo. Does this section need to be revised or removed?
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.
Also this is reflected in the Makefile as well