Skip to content

Commit

Permalink
ci: makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Aug 14, 2021
1 parent b86942c commit d1eab41
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
SOURCE_FILES?=./...
TEST_PATTERN?=.

setup:
go mod tidy
.PHONY: setup

build:
go build
.PHONY: build

test:
go test -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m
.PHONY: test

cover: test
go tool cover -html=coverage.txt
.PHONY: cover

fmt:
gofumpt -w -s -l .
.PHONY: fmt

lint:
golangci-lint run ./...
.PHONY: lint

ci: build test
.PHONY: ci
12 changes: 12 additions & 0 deletions _examples/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import (
"fmt"
"time"

timeago "github.com/caarlos0/timea.go"
)

func main() {
fmt.Println(timeago.Of(time.Now().Add(-5 * time.Second)))
}

0 comments on commit d1eab41

Please sign in to comment.