-
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.
Signed-off-by: Rumen Vasilev <[email protected]>
- Loading branch information
1 parent
34e8170
commit 294241d
Showing
2 changed files
with
19 additions
and
57 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 |
---|---|---|
|
@@ -29,28 +29,20 @@ jobs: | |
run: go version | ||
|
||
- name: Build | ||
run: go build -mod vendor -v ./... | ||
run: make build | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc #v3 | ||
with: | ||
version: v1.54 | ||
|
||
- name: Test | ||
run: go test -mod vendor -race -v ./... | ||
run: make test | ||
|
||
- name: Create coverage report | ||
run: go test -mod vendor -coverprofile=coverage.out -v ./... | ||
run: make coverage | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d #v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# - name: Run GoKart | ||
# uses: kitabisa/[email protected] | ||
# with: | ||
# globalsTainted: true | ||
|
||
# - name: Upload GoKart results | ||
# uses: github/codeql-action/upload-sarif@v1 |
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,15 +1,7 @@ | ||
# | ||
# Copyright (c) 2015, Matt Jones <[email protected]> | ||
# All rights reserved. | ||
# MIT License | ||
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
# | ||
# version 0.1.24 | ||
# | ||
SHELL = /bin/bash | ||
SHELL = /bin/bash | ||
|
||
.PHONY: all build clean coverage help install package pretty test | ||
.DEFAULT_GOAL := help | ||
.PHONY: all build clean coverage lint test | ||
.DEFAULT_GOAL := lint | ||
|
||
# The name of the binary to build | ||
# | ||
|
@@ -43,47 +35,25 @@ ifndef target_arch | |
target_arch = amd64 | ||
endif | ||
|
||
## all Run lint tools, clean and build | ||
all: pretty clean build | ||
## Lint, build | ||
all: pretty build | ||
|
||
## build Download dependencies and build | ||
build: prep | ||
## Build | ||
build: clean | ||
@GOOS=$(target_os) GOARCH=$(target_arch) go build -mod vendor -o ./bin/$(pkg)-$(target_os) | ||
|
||
## release Download dependencies and build release binaries | ||
release: prep | ||
@GOOS=$(target_os) GOARCH=$(target_arch) go build -mod vendor -ldflags="-s -w" -o ./bin/$(pkg)$(target_ext) | ||
|
||
## clean Clean binaries | ||
## Clean binaries | ||
clean: | ||
@rm -rf ./bin | ||
|
||
## help Print available make targets | ||
help: | ||
@echo | ||
@echo "Available make targets:" | ||
@echo | ||
@sed -ne '/@sed/!s/## / /p' $(MAKEFILE_LIST) | ||
|
||
## install Build and save binary in `$GOPATH/bin/` | ||
install: pretty | ||
@GOOS=$(target_os) GOARCH=$(target_arch) go install | ||
|
||
## package Run tests, clean and build binary | ||
package: test clean build | ||
|
||
# TODO set a flag to allow the updating of the packages at build time | ||
## prep Install dependencies | ||
prep: | ||
@go get | ||
|
||
## pretty Run golint, go fmt and go vet | ||
pretty: | ||
@golint ./... | ||
## Lint | ||
lint: | ||
@go fmt ./... | ||
@go vet ./... | ||
@golint ./... | ||
|
||
## test Run tests with coverage | ||
test: pretty | ||
go test -mod vendor ./... -cover -race | ||
## Some tests depend on built binary, make sure you've built it beforehand. | ||
test: | ||
go test -v -mod vendor -race ./... | ||
|
||
coverage: | ||
go test -mod vendor -coverprofile=coverage.out ./... |