-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add linting and code coverage (#89)
* ci: add config for golangci-lint * chore: lint the codebase * ci: add lint job * ci: integrate coveralls * ci: fix missing checkout step in test job * docs: add coverage badge
- Loading branch information
Showing
32 changed files
with
147 additions
and
154 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
name: Lint | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v2 | ||
- name: setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.22.4" | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.59.1 |
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,62 @@ | ||
name: Test | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Docker | ||
uses: docker-practice/actions-setup-docker@master | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.22.4" | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Initialise test config | ||
run: cp .env.test .env | ||
- name: Start raccoon | ||
run: make docker-run | ||
- name: Run tests | ||
run: go test ./... -v -coverprofile=coverage.out | ||
env: | ||
INTEGTEST_BOOTSTRAP_SERVER: 'localhost:9094' | ||
INTEGTEST_HOST: 'localhost:8080' | ||
INTEGTEST_TOPIC_FORMAT: 'clickstream-%s-log' | ||
GRPC_SERVER_ADDR: 'localhost:8081' | ||
PUBSUB_EMULATOR_HOST: 'localhost:8085' | ||
LOCALSTACK_HOST: 'http://localhost:4566' | ||
- name: Upload coverage data | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: coverage.out | ||
smoke-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.22.4" | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: make build | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.22.4" | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Invoking go bench test | ||
run: make test-bench |
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 @@ | ||
run: | ||
timeout: 5m | ||
skip-dirs: | ||
output: | ||
formats: | ||
- format: 'colored-line-number' | ||
linters: | ||
enable-all: false | ||
disable-all: true | ||
enable: | ||
- govet | ||
- goimports | ||
- thelper | ||
- tparallel | ||
- unconvert | ||
- wastedassign | ||
- revive | ||
- staticcheck | ||
- unused | ||
- gofmt | ||
- whitespace | ||
- misspell | ||
linters-settings: | ||
revive: | ||
ignore-generated-header: true | ||
severity: warning | ||
issues: | ||
fix: true | ||
severity: | ||
default-severity: error |
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
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
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
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
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
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 |
---|---|---|
|
@@ -46,5 +46,4 @@ func Contains(key string, slice []string) bool { | |
} | ||
|
||
return 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
Oops, something went wrong.