-
Notifications
You must be signed in to change notification settings - Fork 4
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
71 changed files
with
415 additions
and
220 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,25 @@ | ||
# http://editorconfig.org/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
end_of_line = lf | ||
|
||
[{*.go, go.mod}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[{*.yml,*.yaml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.py] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Makefiles always use tabs for indentation | ||
[Makefile] | ||
indent_style = tab |
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 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: daily |
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,26 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 366 | ||
|
||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 30 | ||
|
||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
- bug | ||
- blocked | ||
- protected | ||
- triaged | ||
|
||
# Label to use when marking an issue as stale | ||
staleLabel: stale | ||
|
||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
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,49 @@ | ||
name: CI | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.runner }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runner: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Get Go environment | ||
id: go-env | ||
run: | | ||
echo "::set-output name=cache::$(go env GOCACHE)" | ||
echo "::set-output name=modcache::$(go env GOMODCACHE)" | ||
- name: Set up cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
${{ steps.go-env.outputs.cache }} | ||
${{ steps.go-env.outputs.modcache }} | ||
key: test-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
test-${{ runner.os }}-go- | ||
- name: Download dependencies | ||
run: go mod download && go mod tidy | ||
|
||
- name: Run tests | ||
run: make test |
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,12 @@ | ||
name: Lint Commit Messages | ||
on: [pull_request] | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'dependabot[bot]' | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- uses: wagoid/[email protected] |
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,72 @@ | ||
name: Coverage | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Get Go environment | ||
id: go-env | ||
run: | | ||
echo "::set-output name=cache::$(go env GOCACHE)" | ||
echo "::set-output name=modcache::$(go env GOMODCACHE)" | ||
- name: Set up cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
${{ steps.go-env.outputs.cache }} | ||
${{ steps.go-env.outputs.modcache }} | ||
key: test-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
test-${{ runner.os }}-go- | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Download dependencies | ||
run: go mod download && go mod tidy | ||
|
||
- name: Run tests with coverage | ||
run: make coverage | ||
|
||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage | ||
path: profile.out | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
- name: Send coverage | ||
uses: codecov/[email protected] | ||
with: | ||
file: profile.out | ||
|
||
upload: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Download artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage | ||
|
||
- name: Send coverage | ||
uses: codecov/[email protected] | ||
with: | ||
file: profile.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,94 @@ | ||
name: Lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
args: --timeout 5m | ||
skip-go-installation: true | ||
|
||
# Check if there are any dirty changes after go mod tidy | ||
check-mod: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Get Go environment | ||
id: go-env | ||
run: | | ||
echo "::set-output name=cache::$(go env GOCACHE)" | ||
echo "::set-output name=modcache::$(go env GOMODCACHE)" | ||
- name: Set up cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
${{ steps.go-env.outputs.cache }} | ||
${{ steps.go-env.outputs.modcache }} | ||
key: check-mod-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
check-mod-${{ runner.os }}-go- | ||
- name: Download dependencies | ||
run: go mod download && go mod tidy | ||
|
||
- name: Check git diff | ||
run: git diff --exit-code | ||
|
||
# Check if there are any dirty changes after go generate | ||
check-generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Get Go environment | ||
id: go-env | ||
run: | | ||
echo "::set-output name=cache::$(go env GOCACHE)" | ||
echo "::set-output name=modcache::$(go env GOMODCACHE)" | ||
- name: Set up cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
${{ steps.go-env.outputs.cache }} | ||
${{ steps.go-env.outputs.modcache }} | ||
key: check-generate-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
check-generate-${{ runner.os }}-go- | ||
- name: Download dependencies | ||
run: go mod download && go mod tidy | ||
|
||
- name: Check git diff | ||
run: git diff --exit-code |
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,27 @@ | ||
name: Extra | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
vulns: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: List dependencies | ||
run: go list -json -m all > go.list | ||
|
||
- name: Run nancy | ||
uses: sonatype-nexus-community/[email protected] |
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 |
---|---|---|
|
@@ -2,3 +2,11 @@ | |
/bug_test.go | ||
/coverage.txt | ||
/.idea | ||
.idea | ||
_bin/* | ||
./examples | ||
|
||
*-fuzz.zip | ||
|
||
*.out | ||
*.dump |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.