-
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
f0fede0
commit ac19568
Showing
114 changed files
with
28,262 additions
and
8 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 @@ | ||
# See: http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
indent_style = tab | ||
max_line_length = 80 | ||
|
||
[*.go] | ||
indent_style = tab | ||
max_line_length = 0 | ||
|
||
[*.md] | ||
indent_size = 2 | ||
indent_style = space | ||
max_line_length = 80 | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab | ||
max_line_length = 0 | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 | ||
max_line_length = 0 | ||
|
||
[*.editorconfig] | ||
indent_style = space | ||
indent_size = 2 | ||
max_line_length = 0 |
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,60 @@ | ||
name: Coverage Badge | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Update coverage badge | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | ||
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19' | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run Test | ||
run: | | ||
go test ./... -covermode=count -coverprofile=coverage.out | ||
go tool cover -func=coverage.out -o=coverage.out | ||
- name: Go Coverage Badge # Pass the `coverage.out` output to this action | ||
uses: tj-actions/[email protected] | ||
with: | ||
filename: coverage.out | ||
|
||
- name: Verify Changed files | ||
uses: tj-actions/[email protected] | ||
id: verify-changed-files | ||
with: | ||
files: README.md | ||
|
||
- name: Commit changes | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Coverage Reporter" | ||
git add README.md | ||
git commit -m "chore: Updated coverage badge." | ||
- name: Push changes | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ github.token }} | ||
branch: ${{ github.head_ref }} |
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
name: Go | ||
name: Static Analysis | ||
|
||
on: ["push", "pull_request"] | ||
on: | ||
push: | ||
branches: ['master'] | ||
pull_request: | ||
branches: ['**'] | ||
|
||
jobs: | ||
ci: | ||
|
@@ -9,16 +13,14 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
go: ["1.18.5", "1.19"] | ||
go: ["1.18", "1.19"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- uses: WillAbides/[email protected] | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- run: "go test ./..." | ||
- run: "go test --race ./..." | ||
- run: "go vet ./..." | ||
- uses: dominikh/[email protected] | ||
with: | ||
|
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 @@ | ||
*.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,25 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- exportloopref | ||
- goimports | ||
- revive | ||
- gosimple | ||
- ineffassign | ||
- misspell | ||
- prealloc | ||
- rowserrcheck | ||
- sqlclosecheck | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- varcheck | ||
- vet | ||
|
||
linters-settings: | ||
goimports: | ||
local-prefixes: github.com/simplesurance/proteus |
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,9 @@ | ||
all: check | ||
|
||
check: | ||
staticcheck ./... | ||
go test --race ./... | ||
|
||
cover: | ||
go test ./... -covermode=count -coverprofile=coverage.out | ||
go tool cover -html=coverage.out |
Oops, something went wrong.