Skip to content

Commit

Permalink
Updated makefile, mergify, labels and badge
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Aug 18, 2021
1 parent bcc0286 commit 91d5dcd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@
- color: FFA500
description: "Any significant refactoring"
name: "refactor"
- color: FEF2C0
description: "Used for automatic merging"
name: "automerge"
- color: FBCA04
description: "Used for denoting a WIP, stops auto-merge"
name: "work-in-progress"
- color: c2e0c6
description: "Old, unused, stale"
name: "stale"
18 changes: 8 additions & 10 deletions .mergify.yml → .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ pull_request_rules:
- name: Automatic Merge ⬇️ on Approval ✔
conditions:
- "#approved-reviews-by>=1"
- label!=work-in-progress
- check-success='test (1.14.x, ubuntu-latest)'
- check-success='test (1.15.x, ubuntu-latest)'
- check-success='test (1.16.x, ubuntu-latest)'
- check-success='Analyze (go)'
- -draft
actions:
merge:
Expand Down Expand Up @@ -166,8 +171,7 @@ pull_request_rules:
actions:
comment:
message: |
Welcome to our open-source project!
We're delighted to have you onboard 💘
Welcome to our open-source project! 💘
# ===============================================================================
# STALE BRANCHES
Expand All @@ -182,6 +186,8 @@ pull_request_rules:
close:
message: |
This pull request looks stale. Feel free to reopen it if you think it's a mistake.
label:
add: [ "stale" ]

# ===============================================================================
# BRANCHES
Expand All @@ -193,14 +199,6 @@ pull_request_rules:
actions:
delete_head_branch:

#- name: automatic update for PR marked as “Ready-to-Go“
# conditions:
# - -conflict # skip PRs with conflicts
# - -draft # filter-out GH draft PRs
# - label="Ready-to-Go"
# actions:
# update:

# ===============================================================================
# CONVENTION
# ===============================================================================
Expand Down
14 changes: 10 additions & 4 deletions .make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DARWIN=$(BINARY_NAME)-darwin
LINUX=$(BINARY_NAME)-linux
WINDOWS=$(BINARY_NAME)-windows.exe

.PHONY: test lint vet install
.PHONY: test lint vet install generate

bench: ## Run all benchmarks in the Go application
@go test -bench=. -benchmem
Expand All @@ -27,6 +27,9 @@ clean-mods: ## Remove all the Go mod cache
coverage: ## Shows the test coverage
@go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out

generate: ## Runs the go generate command in the base of the repo
@go generate -v

godocs: ## Sync the latest tag with GoDocs
@test $(GIT_DOMAIN)
@test $(REPO_OWNER)
Expand All @@ -42,11 +45,11 @@ install-go: ## Install the application (Using Native Go)

lint: ## Run the golangci-lint application (install if not found)
@#Travis (has sudo)
@if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.41.1 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi;
@if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.0 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi;
@#AWS CodePipeline
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1; fi;
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.0; fi;
@#Github Actions
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.41.1; fi;
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.42.0; fi;
@#Brew - MacOS
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then brew install golangci-lint; fi;
@echo "running golangci-lint..."
Expand All @@ -57,6 +60,9 @@ test: ## Runs vet, lint and ALL tests
@echo "running tests..."
@go test ./... -v

test-unit: ## Runs tests and outputs coverage
@go test ./... -race -coverprofile=coverage.txt -covermode=atomic

test-short: ## Runs vet, lint and tests (excludes integration tests)
@$(MAKE) lint
@echo "running tests (short)..."
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Report](https://goreportcard.com/badge/github.com/tonicpow/go-minercraft?style=flat&v=3)](https://goreportcard.com/report/github.com/tonicpow/go-minercraft)
[![codecov](https://codecov.io/gh/tonicpow/go-minercraft/branch/master/graph/badge.svg?v=3)](https://codecov.io/gh/tonicpow/go-minercraft)
[![Go](https://img.shields.io/github/go-mod/go-version/tonicpow/go-minercraft?v=3)](https://golang.org/)
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/tonicpow/go-minercraft&style=flat&v=3)](https://mergify.io)

<br/>

Expand Down Expand Up @@ -86,6 +87,7 @@ all Runs multiple commands
clean Remove previous builds and any test cache data
clean-mods Remove all the Go mod cache
coverage Shows the test coverage
generate Runs the go generate command in the base of the repo
godocs Sync the latest tag with GoDocs
help Show this help message
install Install the application
Expand All @@ -104,6 +106,7 @@ test-ci Runs all tests via CI (exports coverage)
test-ci-no-race Runs all tests via CI (no race) (exports coverage)
test-ci-short Runs unit tests via CI (exports coverage)
test-short Runs vet, lint and tests (excludes integration tests)
test-unit Runs tests and outputs coverage
uninstall Uninstall the application (and remove files)
update-linter Update the golangci-lint package (macOS only)
vet Run the Go vet application
Expand Down Expand Up @@ -162,6 +165,7 @@ The most basic way to show your support is to star :star2: the project, or to ra
You can also support this project by [becoming a sponsor on GitHub](https://github.com/sponsors/tonicpow) :clap:
or by making a [**bitcoin donation**](https://tonicpow.com/?utm_source=github&utm_medium=sponsor-link&utm_campaign=go-minercraft&utm_term=go-minercraft&utm_content=go-minercraft) to ensure this journey continues indefinitely! :rocket:

[![Stars](https://img.shields.io/github/stars/tonicpow/go-minercraft?label=Please%20like%20us&style=social)](https://github.com/tonicpow/go-minercraft/stargazers)

### Credits

Expand Down

0 comments on commit 91d5dcd

Please sign in to comment.