-
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
0 parents
commit 8c153f7
Showing
44 changed files
with
2,992 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,32 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "feat" | ||
include: "scope" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "chore" | ||
include: "scope" | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
labels: | ||
- "dependencies" | ||
commit-message: | ||
prefix: "feat" | ||
include: "scope" |
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 @@ | ||
name: Lint Commit Messages | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: wagoid/commitlint-github-action@v5 |
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 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.19 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: ghcr-login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
paths: | ||
- '**.go' | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.19' | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.50.0 | ||
args: -c .golang-ci.yml -v --timeout=5m | ||
env: | ||
GO111MODULES: off |
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,34 @@ | ||
name: Test and coverage | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.19.x] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: go get | ||
run: go get ./... | ||
|
||
- name: go mod tidy | ||
run: go mod tidy | ||
|
||
- name: Run coverage | ||
run: go test -race -coverprofile="coverage.out" -covermode=atomic ./... | ||
|
||
- name: Upload coverage to Codecov | ||
if: matrix.os == 'ubuntu-latest' | ||
run: bash <(curl -s https://codecov.io/bash) |
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,7 @@ | ||
golang-cli-template | ||
vendor/ | ||
coverage.out | ||
/dist | ||
.envrc | ||
manpages/ | ||
dist/ |
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,42 @@ | ||
--- | ||
image: tetafro/golang-gcc:1.19-alpine | ||
|
||
stages: | ||
- lint | ||
- build | ||
- test | ||
- release | ||
|
||
lint: | ||
stage: lint | ||
before_script: | ||
- wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.41.1 | ||
script: | ||
- ./bin/golangci-lint run -c .golang-ci.yml | ||
allow_failure: true | ||
|
||
build: | ||
stage: build | ||
script: | ||
- go build | ||
|
||
test: | ||
stage: test | ||
script: | ||
- go test -v -race "$(go list ./... | grep -v /vendor/)" -v -coverprofile=coverage.out | ||
- go tool cover -func=coverage.out | ||
|
||
release: | ||
stage: release | ||
image: | ||
name: goreleaser/goreleaser:v0.164.0 | ||
entrypoint: ["/bin/bash", "-c"] | ||
only: | ||
refs: | ||
- tags | ||
variables: | ||
GITLAB_TOKEN: $GITLAB_TOKEN | ||
|
||
script: | ||
- cd "$CI_PROJECT_DIR" | ||
- goreleaser release --rm-dist |
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,27 @@ | ||
linters-settings: | ||
lll: | ||
line-length: 180 | ||
linters: | ||
enable-all: true | ||
disable: | ||
- testpackage | ||
- forbidigo | ||
- paralleltest | ||
- exhaustivestruct | ||
- varnamelen | ||
- interfacer | ||
- maligned | ||
- scopelint | ||
- golint | ||
- varcheck | ||
- nosnakecase | ||
- deadcode | ||
- ifshort | ||
- structcheck | ||
- rowserrcheck | ||
- sqlclosecheck | ||
- structcheck | ||
- wastedassign | ||
- exhaustruct | ||
- nolintlint | ||
- wrapcheck |
Oops, something went wrong.