Skip to content

Commit 7ef6d7e

Browse files
committed
Add 'checks' Make and CI tasks
Introduce new "checks" targets that perform tasks that we've been piling onto the linting tasks. This will make the linter tasks faster and hopefully encourage some users to use them locally.
1 parent f1a42f5 commit 7ef6d7e

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

.drone.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ steps:
3434
GOSUMDB: sum.golang.org
3535
TAGS: bindata sqlite sqlite_unlock_notify
3636

37+
- name: checks-frontend
38+
pull: always
39+
image: node:12
40+
commands:
41+
- make checks-frontend
42+
depends_on: [deps-frontend]
43+
44+
- name: checks-backend
45+
pull: always
46+
image: golang:1.14
47+
commands:
48+
- make checks-backend
49+
depends_on: [lint-backend]
50+
3751
- name: build-frontend
3852
pull: always
3953
image: node:10 # this step is kept at the lowest version of node that we support
@@ -49,7 +63,7 @@ steps:
4963
GOPROXY: off
5064
commands:
5165
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
52-
depends_on: [lint-backend]
66+
depends_on: [checks-backend]
5367

5468
- name: build-backend-arm64
5569
pull: always
@@ -63,7 +77,7 @@ steps:
6377
commands:
6478
- make backend # test cross compile
6579
- rm ./gitea # clean
66-
depends_on: [lint-backend]
80+
depends_on: [checks-backend]
6781

6882
- name: build-backend-386
6983
pull: always
@@ -75,7 +89,7 @@ steps:
7589
GOARCH: 386
7690
commands:
7791
- go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit
78-
depends_on: [lint-backend]
92+
depends_on: [checks-backend]
7993

8094
---
8195
kind: pipeline

Makefile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,26 @@ fmt-check:
290290
exit 1; \
291291
fi;
292292

293-
.PHONY: lint
294-
lint: lint-backend lint-frontend
293+
.PHONY: checks
294+
checks: checks-frontend checks-backend
295295

296-
.PHONY: lint-backend
297-
lint-backend: golangci-lint revive vet swagger-check swagger-validate test-vendor
296+
.PHONY: checks-frontend
297+
checks-frontend: svg-check
298+
299+
.PHONY: checks-backend
300+
checks-backend: misspell-check test-vendor swagger-check swagger-validate
301+
302+
.PHONY: lint
303+
lint: lint-frontend lint-backend
298304

299305
.PHONY: lint-frontend
300-
lint-frontend: node_modules svg-check
306+
lint-frontend: node_modules
301307
npx eslint web_src/js build webpack.config.js
302308
npx stylelint web_src/less
303309

310+
.PHONY: lint-backend
311+
lint-backend: golangci-lint revive vet
312+
304313
.PHONY: watch-frontend
305314
watch-frontend: node-check $(FOMANTIC_DEST) node_modules
306315
rm -rf $(WEBPACK_DEST_ENTRIES)

0 commit comments

Comments
 (0)