-
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
Showing
19 changed files
with
2,715 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,16 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
insert_final_newline = true | ||
max_line_length = 160 | ||
tab_width = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[Makefile] | ||
indent_style = space | ||
|
||
[*.feature] | ||
indent_style = space |
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,38 @@ | ||
name: lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2.5.2 | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: v1.42.0 | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# args: --issues-exit-code=0 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
|
||
# Optional: if set to true then the action will use pre-installed Go. | ||
# skip-go-installation: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | ||
# skip-pkg-cache: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | ||
# 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,60 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
GO111MODULE: "on" | ||
GO_LATEST_VERSION: "1.17.x" | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest ] | ||
go-version: [ 1.16.x, 1.17.x ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Go cache | ||
uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-cache-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ matrix.go-version }}-cache | ||
- name: Test | ||
id: test | ||
run: | | ||
make test | ||
- name: Upload code coverage (unit) | ||
if: matrix.go-version == env.GO_LATEST_VERSION | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./unit.coverprofile | ||
flags: unittests-${{ runner.os }} | ||
|
||
- name: Upload code coverage (features) | ||
if: matrix.go-version == env.GO_LATEST_VERSION | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./features.coverprofile | ||
flags: featurestests-${{ runner.os }} |
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,17 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
/vendor | ||
|
||
*.coverprofile |
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 @@ | ||
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml | ||
run: | ||
tests: true | ||
|
||
linters-settings: | ||
errcheck: | ||
check-type-assertions: true | ||
check-blank: true | ||
gocyclo: | ||
min-complexity: 20 | ||
dupl: | ||
threshold: 100 | ||
misspell: | ||
locale: US | ||
unused: | ||
check-exported: false | ||
unparam: | ||
check-exported: true | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- exhaustivestruct | ||
- forbidigo | ||
- forcetypeassert | ||
- gci | ||
- gochecknoglobals | ||
- golint | ||
- gomnd | ||
- ifshort | ||
- interfacer | ||
- lll | ||
- maligned | ||
- paralleltest | ||
- scopelint | ||
- testpackage | ||
- wrapcheck | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude-rules: | ||
- linters: | ||
- dupl | ||
- funlen | ||
- goconst | ||
- goerr113 | ||
- gomnd | ||
- noctx | ||
path: "_test.go" |
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 @@ | ||
VENDOR_DIR = vendor | ||
|
||
GO ?= go | ||
GOLANGCI_LINT ?= golangci-lint | ||
|
||
.PHONY: $(VENDOR_DIR) lint test test-unit test-integration | ||
|
||
$(VENDOR_DIR): | ||
@mkdir -p $(VENDOR_DIR) | ||
@$(GO) mod vendor | ||
@$(GO) mod tidy | ||
|
||
lint: | ||
@$(GOLANGCI_LINT) run | ||
|
||
test: test-unit test-integration | ||
|
||
## Run unit tests | ||
test-unit: | ||
@echo ">> unit test" | ||
@$(GO) test -gcflags=-l -coverprofile=unit.coverprofile -covermode=atomic -race ./... | ||
|
||
test-integration: | ||
@echo ">> integration test" | ||
@$(GO) test ./features/... -gcflags=-l -coverprofile=features.coverprofile -coverpkg ./... -godog -race |
Oops, something went wrong.