Skip to content

Commit 8dd5ab2

Browse files
sapkzeripath
authored andcommitted
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 test
1 parent c76c70a commit 8dd5ab2

File tree

2 files changed

+3
-73
lines changed

2 files changed

+3
-73
lines changed

.drone.yml

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -124,52 +124,6 @@ steps:
124124
TAGS: bindata sqlite sqlite_unlock_notify
125125
GITHUB_READ_TOKEN:
126126
from_secret: github_read_token
127-
when:
128-
branch:
129-
- master
130-
event:
131-
- push
132-
- pull_request
133-
134-
- name: release-test
135-
pull: always
136-
image: golang:1.13
137-
commands:
138-
- make test
139-
environment:
140-
GOPROXY: off
141-
TAGS: bindata sqlite sqlite_unlock_notify
142-
when:
143-
branch:
144-
- "release/*"
145-
event:
146-
- push
147-
- pull_request
148-
149-
- name: tag-pre-condition
150-
pull: always
151-
image: alpine/git
152-
commands:
153-
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
154-
depends_on:
155-
- build
156-
when:
157-
event:
158-
- tag
159-
160-
- name: tag-test
161-
pull: always
162-
image: golang:1.13
163-
commands:
164-
- make test
165-
environment:
166-
GOPROXY: off
167-
TAGS: bindata
168-
depends_on:
169-
- tag-pre-condition
170-
when:
171-
event:
172-
- tag
173127

174128
- name: test-mysql
175129
pull: always
@@ -185,30 +139,6 @@ steps:
185139
TEST_LDAP: 1
186140
depends_on:
187141
- build
188-
when:
189-
branch:
190-
- master
191-
event:
192-
- push
193-
- pull_request
194-
195-
- name: tag-test-mysql
196-
pull: always
197-
image: golang:1.13
198-
commands:
199-
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
200-
- apt-get install -y git-lfs
201-
- timeout -s ABRT 20m make test-mysql-migration
202-
- timeout -s ABRT 20m make test-mysql
203-
environment:
204-
GOPROXY: off
205-
TAGS: bindata
206-
TEST_LDAP: 1
207-
depends_on:
208-
- build
209-
when:
210-
event:
211-
- tag
212142

213143
- name: test-mysql8
214144
pull: always

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fmt-check:
220220
fi;
221221

222222
.PHONY: test
223-
test: git-check
223+
test:
224224
GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
225225

226226
.PHONY: test\#%
@@ -236,7 +236,7 @@ coverage:
236236

237237
.PHONY: unit-test-coverage
238238
unit-test-coverage:
239-
$(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
239+
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
240240

241241
.PHONY: vendor
242242
vendor:
@@ -374,7 +374,7 @@ integrations.mssql.test: git-check $(GO_SOURCES)
374374
integrations.sqlite.test: git-check $(GO_SOURCES)
375375
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
376376

377-
integrations.cover.test: $(GO_SOURCES)
377+
integrations.cover.test: git-check $(GO_SOURCES)
378378
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
379379

380380
.PHONY: migrations.mysql.test

0 commit comments

Comments
 (0)