-
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.
* Add CI pipeline * Fix revive issue
- Loading branch information
Showing
3 changed files
with
86 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,57 @@ | ||
name: GoURN CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.20.x | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.20.x | ||
cache-dependency-path: go.sum | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: go-fmt | ||
run: | | ||
if [ -n "$(gofmt -s -l .)" ]; then | ||
echo "Go code is not formatted, run 'gofmt -s -w .'" | ||
exit 1 | ||
fi | ||
- name: go-vet | ||
run: go vet ./... | ||
|
||
- name: revive | ||
run: | | ||
go install github.com/mgechev/[email protected] | ||
revive -config .revive.toml -formatter friendly ./... | ||
test: | ||
name: Test | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go 1.20.x | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.20.x | ||
cache-dependency-path: go.sum | ||
|
||
- name: Test GoURN | ||
run: go test -v -covermode=count -coverprofile=coverage.out ./... |
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,28 @@ | ||
ignoreGeneratedHeader = false | ||
severity = "warning" | ||
confidence = 0.8 | ||
errorCode = 1 | ||
warningCode = 1 | ||
|
||
[rule.blank-imports] | ||
[rule.context-as-argument] | ||
[rule.context-keys-type] | ||
[rule.dot-imports] | ||
[rule.empty-block] | ||
[rule.error-naming] | ||
[rule.error-return] | ||
[rule.error-strings] | ||
[rule.errorf] | ||
[rule.exported] | ||
[rule.increment-decrement] | ||
[rule.indent-error-flow] | ||
[rule.range] | ||
[rule.receiver-naming] | ||
[rule.redefines-builtin-id] | ||
[rule.superfluous-else] | ||
[rule.time-naming] | ||
[rule.unexported-return] | ||
[rule.unreachable-code] | ||
[rule.unused-parameter] | ||
[rule.var-declaration] | ||
[rule.var-naming] |
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