diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4222c9b..07d1f3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 11838f7..39cb066 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/.gitignore b/.gitignore index f14e605..5c03997 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .* *.log +*.out !.github/ !.husky/ !.editorconfig @@ -7,6 +8,4 @@ !.golangci.yml !.goreleaser.yml !.husky.yaml -/coverage.out -/coverage.html /tmp/ diff --git a/.golangci.yml b/.golangci.yml index edc3188..f86e30c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,6 @@ run: - timeout: 5m + skip-dirs: + - tmp linters-settings: # https://golangci-lint.run/usage/linters/#revive diff --git a/.goreleaser.yml b/.goreleaser.yml index 65027d3..fbb8188 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 diff --git a/.husky.yaml b/.husky.yaml index fb2448e..2bbd935 100644 --- a/.husky.yaml +++ b/.husky.yaml @@ -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\w+)(\((?P[\w/.-]+)\))?(?P!)?:( +)?(?P
.+)' diff --git a/Makefile b/Makefile index a2ace4a..08b42e1 100644 --- a/Makefile +++ b/Makefile @@ -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