-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved to GH actions; Added lint; Added issue/PR templates. (#296)
* Moved to GH actions; Added lint; Added issue/PR templates; Fixed vet Signed-off-by: Bartlomiej Plotka <[email protected]> * Fixed linter detected issues. Signed-off-by: Bartlomiej Plotka <[email protected]> * Modify the require_clean_work_tree function (#307) * Fixed linter detected issues. Signed-off-by: Bartlomiej Plotka <[email protected]> * Add format-only flag Signed-off-by: Yash Sharma <[email protected]> * Modify the require_clean_work_tree function. Taken from - https://github.com/git/git/blob/master/git-sh-setup.sh#L211 Signed-off-by: Yash Sharma <[email protected]> Added a git script Signed-off-by: Yash Sharma <[email protected]> chmod change Signed-off-by: Yash Sharma <[email protected]> changes to git-tree.sh Signed-off-by: Yash Sharma <[email protected]> Modified makefile Signed-off-by: Yash Sharma <[email protected]> clean up changes Signed-off-by: Yash Sharma <[email protected]> * Bump timeout deadline to 100ms Signed-off-by: Yash Sharma <[email protected]> Co-authored-by: Bartlomiej Plotka <[email protected]> * Skipped retry call timeout tests, will fix in later PR. Signed-off-by: Bartlomiej Plotka <[email protected]> * Fixed race. Signed-off-by: Bartlomiej Plotka <[email protected]> Co-authored-by: Yash Sharma <[email protected]>
- Loading branch information
1 parent
b99e582
commit 880c174
Showing
54 changed files
with
1,963 additions
and
402 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,12 @@ | ||
|
||
# Ignore everything | ||
* | ||
|
||
# But not these files: | ||
!.gitignore | ||
!*.mod | ||
!README.md | ||
!Variables.mk | ||
!variables.env | ||
|
||
*tmp.mod |
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,13 @@ | ||
# Project Development Dependencies. | ||
|
||
This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo. | ||
|
||
* Run `bingo get` to install all tools having each own module file in this directory. | ||
* Run `bingo get <tool>` to install <tool> that have own module file in this directory. | ||
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod. | ||
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool | ||
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies. | ||
|
||
## Requirements | ||
|
||
* Go 1.14+ |
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,54 @@ | ||
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.2. DO NOT EDIT. | ||
# All tools are designed to be build inside $GOBIN. | ||
GOPATH ?= $(shell go env GOPATH) | ||
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin | ||
GO ?= $(shell which go) | ||
|
||
# Bellow generated variables ensure that every time a tool under each variable is invoked, the correct version | ||
# will be used; reinstalling only if needed. | ||
# For example for bingo variable: | ||
# | ||
# In your main Makefile (for non array binaries): | ||
# | ||
#include .bingo/Variables.mk # Assuming -dir was set to .bingo . | ||
# | ||
#command: $(BINGO) | ||
# @echo "Running bingo" | ||
# @$(BINGO) <flags/args..> | ||
# | ||
BINGO := $(GOBIN)/bingo-v0.2.2 | ||
$(BINGO): .bingo/bingo.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/bingo-v0.2.2" | ||
@cd .bingo && $(GO) build -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.2.2 "github.com/bwplotka/bingo" | ||
|
||
FAILLINT := $(GOBIN)/faillint-v1.5.0 | ||
$(FAILLINT): .bingo/faillint.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/faillint-v1.5.0" | ||
@cd .bingo && $(GO) build -modfile=faillint.mod -o=$(GOBIN)/faillint-v1.5.0 "github.com/fatih/faillint" | ||
|
||
GOIMPORTS := $(GOBIN)/goimports-v0.0.0-20200529172331-a64b76657301 | ||
$(GOIMPORTS): .bingo/goimports.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/goimports-v0.0.0-20200529172331-a64b76657301" | ||
@cd .bingo && $(GO) build -modfile=goimports.mod -o=$(GOBIN)/goimports-v0.0.0-20200529172331-a64b76657301 "golang.org/x/tools/cmd/goimports" | ||
|
||
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.27.0 | ||
$(GOLANGCI_LINT): .bingo/golangci-lint.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/golangci-lint-v1.27.0" | ||
@cd .bingo && $(GO) build -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.27.0 "github.com/golangci/golangci-lint/cmd/golangci-lint" | ||
|
||
MISSPELL := $(GOBIN)/misspell-v0.3.4 | ||
$(MISSPELL): .bingo/misspell.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/misspell-v0.3.4" | ||
@cd .bingo && $(GO) build -modfile=misspell.mod -o=$(GOBIN)/misspell-v0.3.4 "github.com/client9/misspell/cmd/misspell" | ||
|
||
PROTOC_GEN_GOGOFAST := $(GOBIN)/protoc-gen-gogofast-v1.3.1 | ||
$(PROTOC_GEN_GOGOFAST): .bingo/protoc-gen-gogofast.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/protoc-gen-gogofast-v1.3.1" | ||
@cd .bingo && $(GO) build -modfile=protoc-gen-gogofast.mod -o=$(GOBIN)/protoc-gen-gogofast-v1.3.1 "github.com/gogo/protobuf/protoc-gen-gogofast" | ||
|
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,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.14 | ||
|
||
require github.com/bwplotka/bingo v0.2.2 |
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,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.14 | ||
|
||
require github.com/fatih/faillint v1.5.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 @@ | ||
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files. |
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,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.14 | ||
|
||
require golang.org/x/tools v0.0.0-20200529172331-a64b76657301 // cmd/goimports |
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,8 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/golangci/golangci-lint v1.27.0 // cmd/golangci-lint | ||
github.com/securego/gosec v0.0.0-20200316084457-7da9f46445fd // indirect | ||
) |
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,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.14 | ||
|
||
require github.com/client9/misspell v0.3.4 // cmd/misspell |
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,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.14 | ||
|
||
require github.com/gogo/protobuf v1.3.1 // protoc-gen-gogofast |
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,22 @@ | ||
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.2. DO NOT EDIT. | ||
# All tools are designed to be build inside $GOBIN. | ||
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. | ||
local gobin=$(go env GOBIN) | ||
|
||
if [ -z "$gobin" ]; then | ||
gobin="$(go env GOPATH)/bin" | ||
fi | ||
|
||
|
||
BINGO="${gobin}/bingo-v0.2.2" | ||
|
||
FAILLINT="${gobin}/faillint-v1.5.0" | ||
|
||
GOIMPORTS="${gobin}/goimports-v0.0.0-20200529172331-a64b76657301" | ||
|
||
GOLANGCI_LINT="${gobin}/golangci-lint-v1.27.0" | ||
|
||
MISSPELL="${gobin}/misspell-v0.3.4" | ||
|
||
PROTOC_GEN_GOGOFAST="${gobin}/protoc-gen-gogofast-v1.3.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,15 @@ | ||
<!-- | ||
Template relevant to bug reports only! | ||
Keep issue title verbose enough. | ||
--> | ||
|
||
**Go version used**: | ||
|
||
**What happened**: | ||
|
||
**What you expected to happen**: | ||
|
||
**How to reproduce it (as minimally and precisely as possible)**: | ||
|
||
--> |
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,24 @@ | ||
<!-- | ||
Keep PR title verbose enough. | ||
--> | ||
|
||
<!-- | ||
Don't forget about CHANGELOG! | ||
Changelog entry format: | ||
- [#<PR-id>](<PR-URL>) ... | ||
<PR-id> Id of your pull request. | ||
<PR-URL> URL of your PR such as https://github.com/grpc-ecosystem/go-grpc-middleware/pull/<PR-id> | ||
--> | ||
|
||
* [ ] I added CHANGELOG entry for this change. | ||
* [ ] Change is not relevant to the end user. | ||
|
||
## Changes | ||
|
||
<!-- Enumerate changes you made --> | ||
|
||
## Verification | ||
|
||
<!-- How you tested it? How do you know it works? --> |
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,50 @@ | ||
# Configuration for probot-stale - https://github.com/probot/stale | ||
|
||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) | ||
onlyLabels: [] | ||
|
||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable. | ||
# We want stale bot to notify us that something is stale so we can revisit it. | ||
# If one issue is marked as 'reminder' by the reminder bot, we don't mark it as 'stale' again. | ||
exemptLabels: | ||
# This label is hardcoded on remind bot (https://probot.github.io/apps/reminders/) and is used by remind bot when | ||
# issue is being reminded. | ||
- reminder | ||
|
||
# Set to true to ignore issues in a project (defaults to false) | ||
exemptProjects: false | ||
# Set to true to ignore issues in a milestone (defaults to false) | ||
exemptMilestones: false | ||
# Set to true to ignore issues with an assignee (defaults to false) | ||
exemptAssignees: false | ||
# Label to use when marking as stale | ||
staleLabel: stale | ||
|
||
pull: | ||
daysUntilClose: 14 | ||
daysUntilStale: 30 | ||
markComment: > | ||
Hello 👋 Looks like there was no activity on this amazing PR for the last month. | ||
**Do you mind updating us on the status?** Is there anything we can help with? If you plan to still work on it, just comment on this PR or push a commit. Thanks! 🤗 | ||
If there is no activity for the next 2 weeks, this PR will be closed (we can always reopen a PR if you get back to this!). | ||
#unmarkComment: No need for unmark comment. | ||
closeComment: > | ||
Closing for now as promised, let us know if you need this to be reopened! 🤗 | ||
issues: | ||
daysUntilClose: 14 | ||
daysUntilStale: 60 | ||
markComment: > | ||
Hello 👋 Looks like there was no activity on this issue for the last 2 months. | ||
**Do you mind updating us on the status?** Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗 | ||
If there is no activity for the next 2 weeks, this issue will be closed (we can always reopen an issue if requested!). | ||
#unmarkComment: No need for unmark comment. | ||
closeComment: > | ||
Closing for now as promised, let us know if you need this to be reopened! 🤗 | ||
# Limit the number of actions per hour, from 1-30. Default is 30 | ||
limitPerRun: 30 |
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: go | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
name: Linters (Static Analysis) for Go | ||
steps: | ||
- name: Checkout code into the Go module directory. | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
|
||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Linting & vetting. | ||
run: make lint | ||
|
||
tests: | ||
runs-on: ${{ matrix.platform }} | ||
name: Unit tests on Go ${{ matrix.go }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go: [ '1.12.x', '1.13.x', '1.14.x' ] | ||
platform: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Checkout code into the Go module directory. | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Run unit tests. | ||
run: make test | ||
|
||
- name: Calculating code coverage. | ||
run: bash <(curl -s https://codecov.io/bash) |
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
Oops, something went wrong.