Reduce CI go module downloads, add make targets (#18708)
The CI currently downloads all go modules in each pipeline step because go modules reside outside the project directory. Fix this by introducing a volume for the `/go` directory [1] so modules are only downloaded once per pipeline using a new `deps-backend` make target. For completeness, I also included new `deps` and `deps-frontend` targets and the frontend one is also triggered explicitly on CI where needed. [1] https://docs.drone.io/pipeline/kubernetes/examples/language/golang/#dependencies
This commit is contained in:
parent
4e57bd1d30
commit
2ddff74a54
255
.drone.yml
255
.drone.yml
File diff suppressed because it is too large
Load Diff
@ -24,6 +24,10 @@ linters:
|
|||||||
|
|
||||||
run:
|
run:
|
||||||
timeout: 3m
|
timeout: 3m
|
||||||
|
skip-dirs:
|
||||||
|
- node_modules
|
||||||
|
- public
|
||||||
|
- web_src
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
gocritic:
|
gocritic:
|
||||||
|
13
Makefile
13
Makefile
@ -166,6 +166,9 @@ help:
|
|||||||
@echo " - watch-backend watch backend files and continuously rebuild"
|
@echo " - watch-backend watch backend files and continuously rebuild"
|
||||||
@echo " - clean delete backend and integration files"
|
@echo " - clean delete backend and integration files"
|
||||||
@echo " - clean-all delete backend, frontend and integration files"
|
@echo " - clean-all delete backend, frontend and integration files"
|
||||||
|
@echo " - deps install dependencies"
|
||||||
|
@echo " - deps-frontend install frontend dependencies"
|
||||||
|
@echo " - deps-backend install backend dependencies"
|
||||||
@echo " - lint lint everything"
|
@echo " - lint lint everything"
|
||||||
@echo " - lint-frontend lint frontend files"
|
@echo " - lint-frontend lint frontend files"
|
||||||
@echo " - lint-backend lint backend files"
|
@echo " - lint-backend lint backend files"
|
||||||
@ -662,6 +665,16 @@ docs:
|
|||||||
fi
|
fi
|
||||||
cd docs; make trans-copy clean build-offline;
|
cd docs; make trans-copy clean build-offline;
|
||||||
|
|
||||||
|
.PHONY: deps
|
||||||
|
deps: deps-frontend deps-backend
|
||||||
|
|
||||||
|
.PHONY: deps-frontend
|
||||||
|
deps-frontend: node_modules
|
||||||
|
|
||||||
|
.PHONY: deps-backend
|
||||||
|
deps-backend:
|
||||||
|
$(GO) mod download
|
||||||
|
|
||||||
node_modules: package-lock.json
|
node_modules: package-lock.json
|
||||||
npm install --no-save
|
npm install --no-save
|
||||||
@touch node_modules
|
@touch node_modules
|
||||||
|
Loading…
x
Reference in New Issue
Block a user