ci: simplify tag/release by always running coverage (#9774)
* ci: simplify tag/release by always running coverage * use mod and vendor for unit test coverage * remove not needed lfs for unit testrelease/v1.15
parent
c76c70a16c
commit
8dd5ab2a14
70
.drone.yml
70
.drone.yml
|
@ -124,52 +124,6 @@ steps:
|
||||||
TAGS: bindata sqlite sqlite_unlock_notify
|
TAGS: bindata sqlite sqlite_unlock_notify
|
||||||
GITHUB_READ_TOKEN:
|
GITHUB_READ_TOKEN:
|
||||||
from_secret: github_read_token
|
from_secret: github_read_token
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
- name: release-test
|
|
||||||
pull: always
|
|
||||||
image: golang:1.13
|
|
||||||
commands:
|
|
||||||
- make test
|
|
||||||
environment:
|
|
||||||
GOPROXY: off
|
|
||||||
TAGS: bindata sqlite sqlite_unlock_notify
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- "release/*"
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
- name: tag-pre-condition
|
|
||||||
pull: always
|
|
||||||
image: alpine/git
|
|
||||||
commands:
|
|
||||||
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
- name: tag-test
|
|
||||||
pull: always
|
|
||||||
image: golang:1.13
|
|
||||||
commands:
|
|
||||||
- make test
|
|
||||||
environment:
|
|
||||||
GOPROXY: off
|
|
||||||
TAGS: bindata
|
|
||||||
depends_on:
|
|
||||||
- tag-pre-condition
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
- name: test-mysql
|
- name: test-mysql
|
||||||
pull: always
|
pull: always
|
||||||
|
@ -185,30 +139,6 @@ steps:
|
||||||
TEST_LDAP: 1
|
TEST_LDAP: 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
- name: tag-test-mysql
|
|
||||||
pull: always
|
|
||||||
image: golang:1.13
|
|
||||||
commands:
|
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
|
||||||
- apt-get install -y git-lfs
|
|
||||||
- timeout -s ABRT 20m make test-mysql-migration
|
|
||||||
- timeout -s ABRT 20m make test-mysql
|
|
||||||
environment:
|
|
||||||
GOPROXY: off
|
|
||||||
TAGS: bindata
|
|
||||||
TEST_LDAP: 1
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
- name: test-mysql8
|
- name: test-mysql8
|
||||||
pull: always
|
pull: always
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -220,7 +220,7 @@ fmt-check:
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: git-check
|
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: test\#%
|
.PHONY: test\#%
|
||||||
|
@ -236,7 +236,7 @@ coverage:
|
||||||
|
|
||||||
.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
|
GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
||||||
|
|
||||||
.PHONY: vendor
|
.PHONY: vendor
|
||||||
vendor:
|
vendor:
|
||||||
|
@ -374,7 +374,7 @@ integrations.mssql.test: git-check $(GO_SOURCES)
|
||||||
integrations.sqlite.test: git-check $(GO_SOURCES)
|
integrations.sqlite.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
|
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
|
||||||
|
|
||||||
integrations.cover.test: $(GO_SOURCES)
|
integrations.cover.test: git-check $(GO_SOURCES)
|
||||||
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
|
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
|
||||||
|
|
||||||
.PHONY: migrations.mysql.test
|
.PHONY: migrations.mysql.test
|
||||||
|
|
Loading…
Reference in New Issue