From 648e899e9f7f180bf6a9cc0192ca96bcfc47a5ab Mon Sep 17 00:00:00 2001 From: James Mills <1290234+prologic@users.noreply.github.com> Date: Thu, 11 Jul 2019 22:20:59 +1000 Subject: [PATCH] Add Drone CI config --- .drone.yml | 25 +++++++++++++++++++++++++ .gitignore | 1 + Makefile | 4 ++-- README.md | 7 +++++-- go.mod | 1 + go.sum | 7 +++++++ 6 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..59517eb --- /dev/null +++ b/.drone.yml @@ -0,0 +1,25 @@ +kind: pipeline +name: default + +steps: + - name: build + image: golang:latest + commands: + - make test + - make + + - name: coverage + image: plugins/codecov + settings: + token: + from_secret: codecov-token + + - name: notify + image: plugins/webhook + settings: + urls: + - https://msgbus.mills.io/ci.mills.io + when: + status: + - success + - failure diff --git a/.gitignore b/.gitignore index 312e1e4..5527c37 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /pb /pastebin +/coverage.txt diff --git a/Makefile b/Makefile index ab86039..9efd7e2 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ install: go install . test: - go test ./... + go test -v -cover -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... -race ./... clean: - rm -rf pastebin + git clean -f -d -X diff --git a/README.md b/README.md index 79672ec..8e3098c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # pastebin -[![GoDoc](https://godoc.org/github.com/prologic/pastebin?status.svg)](https://godoc.org/github.com/prologic/pastebin) -[![Go Report Card](https://goreportcard.com/badge/github.com/prologic/pastebin)](https://goreportcard.com/report/github.com/prologic/pastebin) +[![Build Status](https://cloud.drone.io/api/badges/prologic/pastebin/status.svg)](https://cloud.drone.io/prologic/pastebin) +[![CodeCov](https://codecov.io/gh/prologic/pastebin/branch/master/graph/badge.svg)](https://codecov.io/gh/prologic/pastebin) +[![Go Report Card](https://goreportcard.com/badge/prologic/pastebin)](https://goreportcard.com/report/prologic/pastebin) +[![GoDoc](https://godoc.org/github.com/prologic/pastebin?status.svg)](https://godoc.org/github.com/prologic/pastebin) +[![Sourcegraph](https://sourcegraph.com/github.com/prologic/pastebin/-/badge.svg)](https://sourcegraph.com/github.com/prologic/pastebin?badge) pastebin is a self-hosted pastebin web app that lets you create and share "ephemeral" data between devices and users. There is a configurable expiry diff --git a/go.mod b/go.mod index 521fc46..5e28da3 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a github.com/renstrom/shortuuid v3.0.0+incompatible + github.com/stretchr/testify v1.3.0 github.com/thoas/stats v0.0.0-20190407194641-965cb2de1678 github.com/timewasted/go-accept-headers v0.0.0-20130320203746-c78f304b1b09 github.com/unrolled/logger v0.0.0-20190327162521-be1a2406c7c9 diff --git a/go.sum b/go.sum index a743a51..cf2e7f7 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtix github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/daaku/go.zipexe v1.0.0 h1:VSOgZtH418pH9L16hC/JrgSNJbbAL26pj7lmD1+CGdY= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -17,10 +19,15 @@ github.com/namsral/flag v1.7.4-pre/go.mod h1:OXldTctbM6SWH1K899kPZcf65KxJiD7Msce github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/renstrom/shortuuid v3.0.0+incompatible h1:F6T1U7bWlI3FTV+JE8HyeR7bkTeYZJntqQLA9ST4HOQ= github.com/renstrom/shortuuid v3.0.0+incompatible/go.mod h1:n18Ycpn8DijG+h/lLBQVnGKv1BCtTeXo8KKSbBOrQ8c= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/thoas/stats v0.0.0-20190407194641-965cb2de1678 h1:kFej3rMKjbzysHYvLmv5iOlbRymDMkNJxbovYb/iP0c= github.com/thoas/stats v0.0.0-20190407194641-965cb2de1678/go.mod h1:GkZsNBOco11YY68OnXUARbSl26IOXXAeYf6ZKmSZR2M= github.com/timewasted/go-accept-headers v0.0.0-20130320203746-c78f304b1b09 h1:QVxbx5l/0pzciWYOynixQMtUhPYC3YKD6EcUlOsgGqw=