Skip to content

Commit d285b5d

Browse files
Add 'checks' Make and CI tasks (#12352)
* 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. * add checks to --help Co-authored-by: techknowlogick <[email protected]>
1 parent d1e67d7 commit d285b5d

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
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: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,16 @@ help:
154154
@echo " - build build everything"
155155
@echo " - frontend build frontend files"
156156
@echo " - backend build backend files"
157+
@echo " - watch-frontend watch frontend files and continuously rebuild"
158+
@echo " - watch-backend watch backend files and continuously rebuild"
157159
@echo " - clean delete backend and integration files"
158160
@echo " - clean-all delete backend, frontend and integration files"
159161
@echo " - lint lint everything"
160162
@echo " - lint-frontend lint frontend files"
161163
@echo " - lint-backend lint backend files"
162-
@echo " - watch-frontend watch frontend files and continuously rebuild"
163-
@echo " - watch-backend watch backend files and continuously rebuild"
164+
@echo " - check run various consistency checks"
165+
@echo " - check-frontend check frontend files"
166+
@echo " - check-backend check backend files"
164167
@echo " - webpack build webpack files"
165168
@echo " - svg build svg files"
166169
@echo " - fomantic build fomantic files"
@@ -290,17 +293,26 @@ fmt-check:
290293
exit 1; \
291294
fi;
292295

293-
.PHONY: lint
294-
lint: lint-backend lint-frontend
296+
.PHONY: checks
297+
checks: checks-frontend checks-backend
295298

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

299308
.PHONY: lint-frontend
300-
lint-frontend: node_modules svg-check
309+
lint-frontend: node_modules
301310
npx eslint web_src/js build webpack.config.js
302311
npx stylelint web_src/less
303312

313+
.PHONY: lint-backend
314+
lint-backend: golangci-lint revive vet
315+
304316
.PHONY: watch-frontend
305317
watch-frontend: node-check $(FOMANTIC_DEST) node_modules
306318
rm -rf $(WEBPACK_DEST_ENTRIES)

0 commit comments

Comments
 (0)