-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
910 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,43 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
main: | ||
name: Main process | ||
runs-on: ubuntu-latest | ||
env: | ||
GO_VERSION: 1.21 | ||
GOLANGCI_LINT_VERSION: v1.55.2 | ||
|
||
steps: | ||
|
||
# https://github.com/marketplace/actions/checkout | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# https://github.com/marketplace/actions/setup-go-environment | ||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
# https://golangci-lint.run/usage/install#other-ci | ||
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }} | ||
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION} | ||
|
||
- name: Check and get dependencies | ||
run: | | ||
go mod download | ||
go mod tidy | ||
git diff --exit-code go.mod | ||
git diff --exit-code go.sum | ||
- name: Build | ||
run: make |
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,34 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
main: | ||
name: Release process | ||
runs-on: ubuntu-latest | ||
env: | ||
GO_VERSION: 1.21 | ||
|
||
steps: | ||
# https://github.com/marketplace/actions/checkout | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# https://github.com/marketplace/actions/setup-go-environment | ||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
version: latest | ||
args: release --clean --timeout=10m | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }} |
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,6 @@ | ||
.gitcookies | ||
.idea | ||
.vscode/ | ||
dist/ | ||
builds/ | ||
*.wasm |
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,161 @@ | ||
run: | ||
timeout: 10m | ||
skip-files: [] | ||
|
||
linters-settings: | ||
govet: | ||
check-shadowing: true | ||
gocyclo: | ||
min-complexity: 12 | ||
maligned: | ||
suggest-new: true | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 3 | ||
funlen: | ||
lines: -1 | ||
statements: 50 | ||
misspell: | ||
locale: US | ||
depguard: | ||
rules: | ||
main: | ||
deny: | ||
- pkg: "github.com/instana/testify" | ||
desc: not allowed | ||
- pkg: "github.com/pkg/errors" | ||
desc: Should be replaced by standard lib errors package | ||
tagalign: | ||
align: false | ||
order: | ||
- xml | ||
- json | ||
- yaml | ||
- yml | ||
- toml | ||
- mapstructure | ||
- url | ||
godox: | ||
keywords: | ||
- FIXME | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- style | ||
- performance | ||
disabled-checks: | ||
- paramTypeCombine # already handle by gofumpt.extra-rules | ||
- whyNoLint # already handle by nonolint | ||
- unnamedResult | ||
- hugeParam | ||
- sloppyReassign | ||
- rangeValCopy | ||
- octalLiteral | ||
- ptrToRefParam | ||
- appendAssign | ||
- ruleguard | ||
- httpNoBody | ||
- exposedSyncMutex | ||
revive: | ||
rules: | ||
- name: struct-tag | ||
- name: blank-imports | ||
- name: context-as-argument | ||
- name: context-keys-type | ||
- name: dot-imports | ||
- name: error-return | ||
- name: error-strings | ||
- name: error-naming | ||
- name: exported | ||
disabled: true | ||
- name: if-return | ||
- name: increment-decrement | ||
- name: var-naming | ||
- name: var-declaration | ||
- name: package-comments | ||
disabled: true | ||
- name: range | ||
- name: receiver-naming | ||
- name: time-naming | ||
- name: unexported-return | ||
- name: indent-error-flow | ||
- name: errorf | ||
- name: empty-block | ||
- name: superfluous-else | ||
- name: unused-parameter | ||
disabled: true | ||
- name: unreachable-code | ||
- name: redefines-builtin-id | ||
testifylint: | ||
enable: | ||
- bool-compare | ||
- compares | ||
- empty | ||
- error-is-as | ||
- error-nil | ||
- expected-actual | ||
- float-compare | ||
- len | ||
- suite-dont-use-pkg | ||
- suite-extra-assert-call | ||
- suite-thelper | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- deadcode # deprecated | ||
- exhaustivestruct # deprecated | ||
- golint # deprecated | ||
- ifshort # deprecated | ||
- interfacer # deprecated | ||
- maligned # deprecated | ||
- nosnakecase # deprecated | ||
- scopelint # deprecated | ||
- structcheck # deprecated | ||
- varcheck # deprecated | ||
- cyclop # duplicate of gocyclo | ||
- sqlclosecheck # not relevant (SQL) | ||
- rowserrcheck # not relevant (SQL) | ||
- execinquery # not relevant (SQL) | ||
- lll | ||
- dupl # not relevant | ||
- prealloc # too many false-positive | ||
- bodyclose # too many false-positive | ||
- gomnd | ||
- testpackage # not relevant | ||
- tparallel # not relevant | ||
- paralleltest # not relevant | ||
- nestif # too many false-positive | ||
- wrapcheck | ||
- goerr113 # not relevant | ||
- nlreturn # not relevant | ||
- wsl # not relevant | ||
- exhaustive # not relevant | ||
- exhaustruct # not relevant | ||
- makezero # not relevant | ||
- forbidigo | ||
- varnamelen # not relevant | ||
- nilnil # not relevant | ||
- ireturn # not relevant | ||
- contextcheck # too many false-positive | ||
- noctx | ||
- forcetypeassert | ||
- errchkjson | ||
- nonamedreturns | ||
- gosmopolitan # not relevant | ||
|
||
issues: | ||
exclude-use-default: false | ||
max-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude: | ||
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked' | ||
- 'exported (type|method|function) (.+) should have comment or be unexported' | ||
- 'ST1000: at least one file in a package should have a package comment' | ||
exclude-rules: | ||
- path: (.+)_test.go | ||
linters: | ||
- funlen | ||
- goconst | ||
- maintidx | ||
|
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 @@ | ||
project_name: plugindemowasm-http-call | ||
|
||
builds: | ||
- binary: plugin.wasm | ||
gobinary: go | ||
no_unique_dist_dir: true | ||
main: . | ||
ldflags: | ||
- '' | ||
goos: | ||
- wasip1 | ||
goarch: | ||
- wasm | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^doc:' | ||
- '^chore:' | ||
- '^chore(deps):' | ||
- '^test:' | ||
- '^tests:' | ||
|
||
archives: | ||
- id: plugindemowasm-http-call | ||
name_template: '{{ .ProjectName }}_v{{ .Version }}' | ||
format: zip | ||
files: | ||
- LICENSE | ||
- .traefik.yml |
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,10 @@ | ||
displayName: Demo Plugin WASM with HTTP Call | ||
runtime: wasm | ||
type: middleware | ||
iconPath: .assets/icon.png | ||
|
||
summary: '[Demo WASM] Add WorldTime from api' | ||
|
||
testData: | ||
HeaderName: X-World-Time | ||
Timezone: Europe/Paris |
Oops, something went wrong.