-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
55c04aa
commit 7edc38a
Showing
4 changed files
with
157 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Continuous Integration | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
types: | ||
- opened | ||
- synchronize | ||
- ready_for_review | ||
paths: | ||
- "**.go" | ||
- "**.mod" | ||
- "**.sum" | ||
|
||
workflow_call: {} | ||
workflow_dispatch: {} | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
uses: ./.github/workflows/lint.yaml | ||
|
||
test: | ||
name: Test | ||
needs: lint | ||
uses: ./.github/workflows/test.yaml |
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,30 @@ | ||
name: Lint | ||
on: | ||
workflow_dispatch: {} | ||
workflow_call: {} | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
golangci: | ||
name: GolangCI Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go 1.18 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.18' | ||
cache: false | ||
|
||
- name: Run Golang CI Lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.52.2 | ||
skip-cache: true | ||
skip-pkg-cache: true | ||
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,25 @@ | ||
name: Test | ||
on: | ||
workflow_dispatch: {} | ||
workflow_call: {} | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go 1.18 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.18' | ||
cache: false | ||
|
||
- name: Run Golang Tests | ||
run: go test ./... -v -race |
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,67 @@ | ||
run: | ||
tests: true | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
timeout: 5m | ||
# exit code when at least one issue was found, default is 1 | ||
issues-exit-code: 1 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- dogsled | ||
- dupl | ||
- depguard | ||
- errname | ||
- errorlint | ||
- forcetypeassert | ||
- exportloopref | ||
- goconst | ||
- gocritic | ||
- gofumpt | ||
- gosec | ||
- gosimple | ||
- govet | ||
- importas | ||
- ineffassign | ||
- lll | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- predeclared | ||
- prealloc | ||
- staticcheck | ||
- stylecheck | ||
- tparallel | ||
- thelper | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- whitespace | ||
- wsl | ||
|
||
issues: | ||
exclude-rules: | ||
- text: "Use of weak random number generator" | ||
linters: | ||
- gosec | ||
|
||
max-issues-per-linter: 10000 | ||
max-same-issues: 10000 | ||
|
||
linters-settings: | ||
dogsled: | ||
max-blank-identifiers: 3 | ||
maligned: | ||
# print struct with more effective memory layout or not, false by default | ||
suggest-new: true | ||
nolintlint: | ||
allow-unused: false # to be set to false once all issues are addressed, any exceptions needed to be added above | ||
allow-leading-space: true | ||
require-explanation: false # nice to have as true | ||
require-specific: false | ||
depguard: | ||
Main: | ||
allow: | ||
- $github.com/sarvalabs/* | ||
- github.com/pkg/errors |