Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
eudore committed Nov 30, 2024
1 parent 803bf34 commit 3e5d508
Show file tree
Hide file tree
Showing 226 changed files with 18,364 additions and 19,689 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/github-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
- uses: golangci/golangci-lint-action@v3
continue-on-error: true
with:
args: --verbose -c .github/workflows/golang-lint.json
args: --verbose --config .github/workflows/golang-lint.json
test:
strategy:
max-parallel: 2
max-parallel: 16
matrix:
os: [macos, ubuntu]
go: ["1.20", "1.21"]
go: ["1.20", "1.21", "1.22", "1.23"]
include:
- os: macos
gopath: /Users/runner/go
Expand All @@ -36,7 +36,7 @@ jobs:
GOPATH: ${{ matrix.gopath }}:${{ github.workspace }}
CGO_ENABLED: 1
WORKDIR: src/github.com/eudore/eudore/
PACKAGES: github.com/eudore/eudore,github.com/eudore/eudore/middleware,github.com/eudore/eudore/policy
PACKAGES: github.com/eudore/eudore,github.com/eudore/eudore/middleware
defaults:
run:
working-directory: ${{ env.WORKDIR }}
Expand All @@ -57,12 +57,20 @@ jobs:
- name: Run Go Get
run: for pkg in $(go list -json _example/*_test.go | jq -r '.XTestImports[]' | grep -E "github.com|golang.org|monkey" | grep -v eudore); do go get -v $pkg; done
- name: Run Tests
run: go test -v -timeout=1m -race -cover -coverprofile=coverage.out -coverpkg='${{ env.PACKAGES }}' _example/*_test.go | tee output
run: go test -v -timeout=1m -race -cover -coverprofile=coverage.out -coverpkg='${{ env.PACKAGES }}' _example/*_test.go
- name: Run Notice
run: go run _example/otherAction.go
run: go run _example/otherCover.go
- name: Run Coverage
if: env.go == '1.20'
run: go tool cover -html coverage.out -o coverage.html
- uses: codecov/codecov-action@v3
if: env.go == '1.20'
with:
working-directory: ${{ env.WORKDIR }}
files: coverage.out
flags: ${{ matrix.os }},go-${{ matrix.go }}
- uses: actions/upload-artifact@v3
if: env.go == '1.20'
with:
name: Coverage-eudore-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.go }}
path: ${{ env.WORKDIR }}/coverage.html
path: ${{ env.WORKDIR }}/coverage.html
166 changes: 116 additions & 50 deletions .github/workflows/golang-lint.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,132 @@
{
"run": {
"timeout": "2m",
"skip-dirs": [
"database",
"database2"
],
"skip-files": [
"run": {"timeout": "2m"},
"issues": {
"max-same-issues": 10,
"exclude-files": [
"funccreator.go",
"funcdefine.go",
"protobuf.go",
"middleware/admin.go",
"middleware/dump.go"
"policy/.*.go"
]
},
"issues": {
"max-same-issues": 10
},
"linters": {
"enable-all": true,
"disable": [
"golint",
"deadcode",
"nosnakecase",
"ifshort",
"scopelint",
"maligned",
"structcheck",
"exhaustivestruct",
"varcheck",
"interfacer",
"disable-all": true,
"enable":[
"asasalint",
"asciicheck",
"bidichk",
"bodyclose",
"canonicalheader",
"copyloopvar",
"cyclop",
"decorder",
"depguard",
"dogsled",
"dupl",
"dupword",
"durationcheck",
"errcheck",
"varnamelen",
"wrapcheck",
"nlreturn",
"errchkjson",
"errname",
"errorlint",
"fatcontext",
"forbidigo",
"funlen",
"gci",
"ginkgolinter",
"gocheckcompilerdirectives",
"gochecknoinits",
"gochecksumtype",
"gocognit",
"goconst",
"gocritic",
"gocyclo",
"godot",
"godox",
"gofmt",
"gofumpt",
"goheader",
"goimports",
"gomoddirectives",
"gomodguard",
"goprintffuncname",
"gosimple",
"gosmopolitan",
"govet",
"grouper",
"iface",
"importas",
"inamedparam",
"ineffassign",
"loggercheck",
"maintidx",
"makezero",
"mirror",
"misspell",
"musttag",
"nakedret",
"nilerr",
"nilnil",
"noctx",
"nolintlint",
"nosprintfhostport",
"paralleltest",
"perfsprint",
"prealloc",
"predeclared",
"promlinter",
"protogetter",
"reassign",
"revive",
"rowserrcheck",
"sloglint",
"spancheck",
"sqlclosecheck",
"staticcheck",
"stylecheck",
"tenv",
"testableexamples",
"testifylint",
"testpackage",
"thelper",
"tparallel",
"unconvert",
"unparam",
"unused",
"usestdlibvars",
"wastedassign",
"whitespace",
"zerologlint"
],
"disable-name":[
"containedctx",
"contextcheck",
"err113",
"exhaustive",
"exhaustruct",
"forcetypeassert",
"gochecknoglobals",
"gosec",
"ireturn",
"interfacebloat",
"gochecknoglobals",
"nonamedreturns",
"forcetypeassert",
"exhaustruct",
"intrange",
"lll",
"gosec",
"wsl",
"containedctx",
"exhaustive",
"contextcheck",
"tagliatelle",
"gomnd",
"goerr113",
"mnd",
"nestif",
"gocognit",
"tagalign"
"nlreturn",
"nonamedreturns",
"recvcheck",
"tagalign",
"tagliatelle",
"varnamelen",
"wrapcheck",
"wsl"
]
},
"linters-settings": {
"gocyclo": {
"min-complexity": 15
},
"cyclop": {
"max-complexity": 15
},
"funlen": {"statements": 50},
"gocyclo": {"min-complexity": 15},
"cyclop": {"max-complexity": 15},
"depguard": {
"rules": {
"main": {
Expand All @@ -67,9 +136,6 @@
]
}
}
},
"funlen": {
"statements": 50
}
}
}
Loading

0 comments on commit 3e5d508

Please sign in to comment.