chore: update github workflow

This commit is contained in:
Kevin Franklin Kim 2023-09-08 12:17:44 +02:00
parent 07f0c394d5
commit 9473fa3dcb
No known key found for this signature in database
7 changed files with 22 additions and 61 deletions

View File

@ -6,15 +6,14 @@ on:
- v*.*.*
workflow_dispatch:
env:
GOFLAGS: -mod=readonly
GOPROXY: https://proxy.golang.org
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
@ -22,8 +21,7 @@ jobs:
- uses: actions/setup-go@v4
with:
check-latest: true
go-version-file: 'go.mod'
go-version-file: 'stable'
- uses: goreleaser/goreleaser-action@v4
with:

View File

@ -4,15 +4,8 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
merge_group:
branches: [ main ]
workflow_dispatch:
env:
GOFLAGS: -mod=readonly
GOPROXY: https://proxy.golang.org
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
@ -21,15 +14,23 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
check-latest: true
go-version-file: 'go.mod'
go-version-file: 'stable'
- uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: golangci/golangci-lint-action@v3
with:
version: latest
- name: Run tests
run: go test -v ./...
- run: make test
- uses: coverallsapp/github-action@v2
with:
file: coverage.out

3
.gitignore vendored
View File

@ -1,5 +1,6 @@
.*
*.log
*.out
!.github/
!.husky/
!.editorconfig
@ -7,6 +8,4 @@
!.golangci.yml
!.goreleaser.yml
!.husky.yaml
/coverage.out
/coverage.html
/tmp/

View File

@ -1,5 +1,6 @@
run:
timeout: 5m
skip-dirs:
- tmp
linters-settings:
# https://golangci-lint.run/usage/linters/#revive

View File

@ -2,33 +2,4 @@ builds:
- skip: true
changelog:
filters:
exclude:
- "^wip"
- "^test"
- "^docs"
- "^chore"
- "^style"
- "go mod tidy"
- "merge conflict"
- "Merge pull request"
- "Merge remote-tracking branch"
- "Merge branch"
groups:
- title: Features
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: Dependency updates
regexp: '^.*?(feat|fix)\(deps\)!?:.+$'
order: 100
- title: "Bug fixes"
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 150
- title: "Security"
regexp: '^.*?sec(\([[:word:]]+\))??!?:.+$'
order: 200
- title: "Performace"
regexp: '^.*?perf(\([[:word:]]+\))??!?:.+$'
order: 250
- title: Other
order: 999
use: github-native

View File

@ -9,9 +9,7 @@ hooks:
lint-staged:
'*.go':
- goimports -l -w
- gofmt -l -w
lint-commit:
email: '^(.+@bestbytes.com)$'
types: '^(feat|fix|build|chore|docs|perf|refactor|revert|style|test|wip)$'
header: '^(?P<type>\w+)(\((?P<scope>[\w/.-]+)\))?(?P<breaking>!)?:( +)?(?P<header>.+)'

View File

@ -27,14 +27,7 @@ doc:
.PHONY: test
## Run tests
test:
@go test -v ./...
.PHONY: test.cover
## Run tests with coverage
test.cover:
@go test -v -coverprofile=coverage.out ./...
@go tool cover -func=coverage.out
@go tool cover -html=coverage.out
@go test -coverprofile=coverage.out -race -json ./... | gotestfmt
.PHONY: lint
## Run linter