From bf9620d18e1391ce96b10544d5a8efec9f56100c Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 26 Apr 2019 19:51:03 +0800 Subject: [PATCH] chore: go support combine all coverage file (#24) * Combine all coverage file in one command * remove generate-coverage * remove unused method: errCheck Signed-off-by: Bo-Yi Wu --- .drone.yml | 13 +------------ Makefile | 14 -------------- README.md | 7 +++++++ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6db2aab..98c03dc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -52,22 +52,11 @@ pipeline: when: event: [ tag ] - generate-coverage: - image: golang:1.12 - pull: true - environment: - TAGS: bindata - commands: - - make coverage - when: - event: [ push, pull_request ] - branch: [ master ] - coverage: image: robertstettner/drone-codecov secrets: [ codecov_token ] files: - - coverage.all + - coverage.out when: event: [ push, pull_request ] branch: [ master ] diff --git a/Makefile b/Makefile index 6ec9f86..56e8449 100644 --- a/Makefile +++ b/Makefile @@ -70,13 +70,6 @@ fmt: vet: $(GO) vet $(PACKAGES) -.PHONY: errcheck -errcheck: - @hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) get -u github.com/kisielk/errcheck; \ - fi - errcheck $(PACKAGES) - .PHONY: lint lint: @hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @@ -112,13 +105,6 @@ fmt-check: test: GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES) -.PHONY: coverage -coverage: - @hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) get -u github.com/wadey/gocovmerge; \ - fi - gocovmerge $(shell find . -type f -name "coverage.out") > coverage.all;\ - .PHONY: unit-test-coverage unit-test-coverage: $(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 diff --git a/README.md b/README.md index 07fa5df..e0ee105 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,32 @@ This project acts as a command line tool for operating one or multiple Gitea ins the Gitea API implementation. ## Installation + Currently no prebuilt binaries are provided. To install, a Go installation is needed. + ```sh go get code.gitea.io/tea go install code.gitea.io/tea ``` If the `tea` executable is not found, you might need to set up your `$GOPATH` and `$PATH` variables first: + ```sh export PATH=$PATH:$GOROOT/bin:$GOPATH/bin ``` ## Usage + First of all, you have to create a token on your `personal settings -> application` page of your gitea instance. Use this token to login with `tea`: + ```sh tea login add --name=try --url=https://try.gitea.io --token=xxxxxx ``` Now you can use the `tea` commands: + ```sh tea issues tea releases @@ -34,6 +40,7 @@ tea releases ## Compilation To compile the sources yourself run the following: + ```sh go get code.gitea.io/tea cd "${GOPATH}/src/code.gitea.io/tea"