mirror of
https://gitea.com/gitea/tea
synced 2024-11-23 00:12:05 +01:00
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 <appleboy.tw@gmail.com>
This commit is contained in:
parent
6aa4629f05
commit
bf9620d18e
13
.drone.yml
13
.drone.yml
@ -52,22 +52,11 @@ pipeline:
|
|||||||
when:
|
when:
|
||||||
event: [ tag ]
|
event: [ tag ]
|
||||||
|
|
||||||
generate-coverage:
|
|
||||||
image: golang:1.12
|
|
||||||
pull: true
|
|
||||||
environment:
|
|
||||||
TAGS: bindata
|
|
||||||
commands:
|
|
||||||
- make coverage
|
|
||||||
when:
|
|
||||||
event: [ push, pull_request ]
|
|
||||||
branch: [ master ]
|
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
image: robertstettner/drone-codecov
|
image: robertstettner/drone-codecov
|
||||||
secrets: [ codecov_token ]
|
secrets: [ codecov_token ]
|
||||||
files:
|
files:
|
||||||
- coverage.all
|
- coverage.out
|
||||||
when:
|
when:
|
||||||
event: [ push, pull_request ]
|
event: [ push, pull_request ]
|
||||||
branch: [ master ]
|
branch: [ master ]
|
||||||
|
14
Makefile
14
Makefile
@ -70,13 +70,6 @@ fmt:
|
|||||||
vet:
|
vet:
|
||||||
$(GO) vet $(PACKAGES)
|
$(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
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||||
@ -112,13 +105,6 @@ fmt-check:
|
|||||||
test:
|
test:
|
||||||
GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
|
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
|
.PHONY: unit-test-coverage
|
||||||
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
|
$(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
||||||
|
@ -4,26 +4,32 @@ This project acts as a command line tool for operating one or multiple Gitea ins
|
|||||||
the Gitea API implementation.
|
the Gitea API implementation.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Currently no prebuilt binaries are provided.
|
Currently no prebuilt binaries are provided.
|
||||||
To install, a Go installation is needed.
|
To install, a Go installation is needed.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
go get code.gitea.io/tea
|
go get code.gitea.io/tea
|
||||||
go install 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:
|
If the `tea` executable is not found, you might need to set up your `$GOPATH` and `$PATH` variables first:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
First of all, you have to create a token on your `personal settings -> application` page of your gitea instance.
|
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`:
|
Use this token to login with `tea`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
tea login add --name=try --url=https://try.gitea.io --token=xxxxxx
|
tea login add --name=try --url=https://try.gitea.io --token=xxxxxx
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can use the `tea` commands:
|
Now you can use the `tea` commands:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
tea issues
|
tea issues
|
||||||
tea releases
|
tea releases
|
||||||
@ -34,6 +40,7 @@ tea releases
|
|||||||
## Compilation
|
## Compilation
|
||||||
|
|
||||||
To compile the sources yourself run the following:
|
To compile the sources yourself run the following:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
go get code.gitea.io/tea
|
go get code.gitea.io/tea
|
||||||
cd "${GOPATH}/src/code.gitea.io/tea"
|
cd "${GOPATH}/src/code.gitea.io/tea"
|
||||||
|
Loading…
Reference in New Issue
Block a user