-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into moul-patch-2
- Loading branch information
Showing
32 changed files
with
595 additions
and
113 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 |
---|---|---|
@@ -1,61 +1,17 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
golang: | ||
working_directory: /go/src/moul.io/golang-repo-template | ||
docker: | ||
- image: circleci/golang:1.12 | ||
environment: | ||
GO111MODULE: "on" | ||
DOCKER_IMAGE: moul/golang-repo-template | ||
|
||
docker: | ||
docker: | ||
- image: docker:18.06.3-ce-git | ||
|
||
orbs: | ||
codecov: codecov/codecov@1.0.5 | ||
moul: moul/build@1.5.0 | ||
retry: moul/retry@0.6.0 | ||
docker: circleci/docker@0.5.13 | ||
#dl: moul/dl@1.7.0 | ||
tools: gotest/tools@0.0.9 | ||
|
||
jobs: | ||
go-build: | ||
executor: golang | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- go-mod-v1-{{ checksum "go.sum" }} | ||
- go-mod-v1- | ||
- retry/install | ||
- tools/mod-download | ||
- tools/mod-tidy-check | ||
- run: retry -m 3 make install | ||
- run: retry -m 3 make test | ||
- moul/install_golangci-lint | ||
- run: PATH=$PATH:$(pwd)/bin retry -m 3 make lint | ||
- codecov/upload: | ||
file: coverage.txt | ||
- save_cache: | ||
key: go-mod-v1-{{ checksum "go.sum" }} | ||
paths: | ||
- /go/pkg/mod | ||
|
||
docker-build: | ||
executor: docker | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- docker/build: | ||
image: moul/golang-repo-template | ||
#- docker/dockerlint | ||
moul: moul/build@1.12.1 # https://github.com/moul/build | ||
|
||
workflows: | ||
main: | ||
jobs: | ||
- go-build | ||
- docker-build | ||
- moul/golang-build: | ||
gopkg: moul.io/golang-repo-template | ||
- moul/golang-build: | ||
gopkg: moul.io/golang-repo-template | ||
tag: '1.12' | ||
- moul/golang-build: | ||
gopkg: moul.io/golang-repo-template | ||
tag: '1.11' | ||
- moul/docker-build |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
run-parts ./githooks/pre-commit.d/ -v --exit-on-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
make generate |
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,53 @@ | ||
#!/bin/bash | ||
|
||
STAGED_GO_FILES=$(git diff --cached --name-only | grep "\.go$") | ||
|
||
if [[ "$STAGED_GO_FILES" = "" ]]; then | ||
exit 0 | ||
fi | ||
|
||
GOLINT=$GOPATH/bin/golint | ||
GOIMPORTS=$GOPATH/bin/goimports | ||
PASS=true | ||
|
||
# Check for golint | ||
if [[ ! -x "$GOLINT" ]]; then | ||
printf "\t\033[41mPlease install golint\033[0m (go get -u golang.org/x/lint/golint)\n" | ||
PASS=false | ||
fi | ||
|
||
# Check for goimports | ||
if [[ ! -x "$GOIMPORTS" ]]; then | ||
printf "\t\033[41mPlease install goimports\033[0m (go get golang.org/x/tools/cmd/goimports)\n" | ||
PASS=false | ||
fi | ||
|
||
if ! $PASS; then | ||
exit 1 | ||
fi | ||
|
||
PASS=true | ||
|
||
for FILE in $STAGED_GO_FILES | ||
do | ||
# Run goimports on the staged file | ||
$GOIMPORTS -w $FILE | ||
|
||
# Run golint on the staged file and check the exit status | ||
$GOLINT "-set_exit_status" $FILE | ||
if [[ $? == 1 ]]; then | ||
printf "\t\033[31mgolint $FILE\033[0m \033[0;30m\033[41mFAILURE!\033[0m\n" | ||
PASS=false | ||
else | ||
printf "\t\033[32mgolint $FILE\033[0m \033[0;30m\033[42mpass\033[0m\n" | ||
fi | ||
done | ||
|
||
if ! $PASS; then | ||
printf "\033[0;30m\033[41mCOMMIT FAILED\033[0m\n" | ||
exit 1 | ||
else | ||
printf "\033[0;30m\033[42mCOMMIT SUCCEEDED\033[0m\n" | ||
fi | ||
|
||
exit 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
File renamed without changes.
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
github: ["moul"] | ||
patreon: moul | ||
open_collective: moul | ||
custom: ["https://manfred.life/about"] | ||
custom: | ||
- "https://www.buymeacoffee.com/moul" | ||
- "https://manfred.life/donate" |
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,31 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "[BUG] " | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Type '....' | ||
3. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots / Logs** | ||
If applicable, add screenshots or logs to help explain your problem. | ||
|
||
**Versions (please complete the following information, if relevant):** | ||
- Software version: [e.g. v1.2.3, latest, building from sources] | ||
- OS: [e.g. Ubuntu, Mac, iOS, ...] | ||
- Golang version [e.g. 1.13] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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 @@ | ||
--- | ||
name: Custom | ||
about: 'Anything else: questions, discussions, thanks, ascii-arts, ...' | ||
title: '' | ||
labels: discussion | ||
assignees: moul | ||
|
||
--- |
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: Feature request | ||
about: Suggest an idea for this project | ||
title: "[IDEA] " | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,9 @@ | ||
<!-- | ||
Thank you for your contribution to this repo! | ||
Before submitting a pull request, please check the following: | ||
- reference any related issue, PR, link | ||
- use the "WIP" title prefix if you need help or more time to finish your PR | ||
you can remove this markdown comment | ||
--> |
File renamed without changes.
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 @@ | ||
name: Semantic Release | ||
|
||
on: push | ||
|
||
jobs: | ||
semantic-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: codfish/semantic-release-action@v1 | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
coverage.txt | ||
|
||
# Vendors | ||
package-lock.json | ||
node_modules/ | ||
vendor/ | ||
|
||
|
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 |
---|---|---|
|
@@ -26,6 +26,7 @@ linters: | |
- errcheck | ||
- unused | ||
- varcheck | ||
- gochecknoinits | ||
- staticcheck | ||
- unconvert | ||
- gofmt | ||
|
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
branch: 'master', | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
'@semantic-release/github', | ||
], | ||
}; |
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,4 @@ | ||
# This file lists all individuals having contributed content to the repository. | ||
# For how it is generated, see 'https://github.com/moul/rules.mk' | ||
|
||
Manfred Touron <m@42.am> |
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 @@ | ||
Copyright 2019 Manfred Touron and other golang-repo-template Developers. | ||
|
||
Intellectual Property Notice | ||
---------------------------- | ||
|
||
golang-repo-template is licensed under the Apache License, Version 2.0 | ||
(see LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or | ||
the MIT license (see LICENSE-MIT or http://opensource.org/licenses/MIT), | ||
at your option. | ||
|
||
Copyrights and patents in the golang-repo-templates project are retained | ||
by contributors. | ||
No copyright assignment is required to contribute to golang-repo-template. | ||
|
||
SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
SPDX usage | ||
---------- | ||
|
||
Individual files may contain SPDX tags instead of the full license text. | ||
This enables machine processing of license information based on the SPDX | ||
License Identifiers that are available here: https://spdx.org/licenses/ |
Oops, something went wrong.