Skip to content

Commit

Permalink
normalize ci cd configs
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Mulvey <kmulvey@linux.com>
  • Loading branch information
kmulvey committed Mar 22, 2023
1 parent 4f45072 commit c852e08
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 36 deletions.
6 changes: 1 addition & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
assignees:
- "kmulvey"
reviewers:
- "kmulvey"
interval: "daily"
34 changes: 16 additions & 18 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,33 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
- name: Set up Go
uses: actions/setup-go@v3
with:
check-latest: true
cache: true
go-version: 1.19
id: go

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m

- name: Govulncheck
uses: kmulvey/govulncheck-action@v1.0.0
go-version: "1.20"

- name: Build & Test
run: |
go mod tidy
go test -v -race -count 1 -parallel 5 -covermode=atomic -coverprofile=coverage.out ./...
go build -v -ldflags="-s -w" ./...
go test -v -race -count 1 -parallel 5 -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3
with:
verbose: true # optional (default = false)

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m

- name: Govulncheck
uses: kmulvey/govulncheck-action@v1.1.2

release:
name: concurrenthash release
runs-on: ubuntu-latest
Expand All @@ -52,18 +51,17 @@ jobs:
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/

- name: Set up Go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
check-latest: true
cache: true
id: go
go-version: "1.20"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --config .goreleaser.yaml --rm-dist
args: release --config .goreleaser.yaml --clean
env:
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Options for analysis running.
run:
concurrency: 2
timeout: 10m
tests: true
modules-download-mode: readonly
go: "1.20"
linters:
#enable-all: true
enable:
- bidichk
- bodyclose
- containedctx
#- cyclop
#- dupl
- exportloopref
- gocritic
- goconst
- gosec
- misspell
- nilerr
- paralleltest
- prealloc
# - unparam https://github.com/mvdan/unparam/issues/52
- usestdlibvars
- wastedassign
linters-settings:
govet:
check-shadowing: false
disable-all: false
enable-all: true
disable:
- shadow
- fieldalignment # giving false positives
34 changes: 21 additions & 13 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy

builds:
- id: concurrenthash
main: ./cmd/main.go
env:
- CGO_ENABLED=0
binary: concurrenthash
ldflags:
- -s -w -X main.build={{.Version}}
goos:
- linux
- freebsd
- windows
- darwin
- linux
- js
goarch:
- amd64
- arm64

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
- id: dist
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parsers:
go:
partials_as_hits: true

0 comments on commit c852e08

Please sign in to comment.