Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook go-licenses into tidy again #21353

Merged
merged 11 commits into from
Oct 10, 2022
16 changes: 3 additions & 13 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ steps:
- name: checks-backend
image: golang:1.19
commands:
- make checks-backend
- make --always-make checks-backend # ensure the 'go-licenses' make target runs
depends_on: [deps-backend]
volumes:
- name: deps
Expand All @@ -112,16 +112,11 @@ steps:
- make test-frontend
depends_on: [lint-frontend]

- name: generate-frontend
image: golang:1.19
commands:
- make generate-frontend

- name: build-frontend
image: node:18
commands:
- make frontend
depends_on: [deps-frontend, generate-frontend]
depends_on: [deps-frontend]

- name: build-backend-no-gcc
image: golang:1.18 # this step is kept as the lowest version of golang that we support
Expand Down Expand Up @@ -549,16 +544,11 @@ steps:
commands:
- make deps-frontend

- name: generate-frontend
image: golang:1.18
commands:
- make generate-frontend

- name: build-frontend
image: node:18
commands:
- make frontend
depends_on: [deps-frontend, generate-frontend]
depends_on: [deps-frontend]

- name: deps-backend
image: golang:1.18
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* text=auto eol=lf
*.tmpl linguist-language=Handlebars
/assets/*.json linguist-generated
/public/vendor/** -text -eol linguist-vendored
/vendor/** -text -eol linguist-vendored
/web_src/fomantic/build/** linguist-generated
Expand Down
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,15 @@ unit-test-coverage:
tidy:
$(eval MIN_GO_VERSION := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
$(GO) mod tidy -compat=$(MIN_GO_VERSION)
@$(MAKE) --no-print-directory $(GO_LICENSE_FILE)

vendor: go.mod go.sum
$(GO) mod vendor
@touch vendor

.PHONY: tidy-check
tidy-check: tidy
@diff=$$(git diff go.mod go.sum); \
@diff=$$(git diff go.mod go.sum $(GO_LICENSE_FILE)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make tidy' and commit the result:"; \
echo "$${diff}"; \
Expand Down Expand Up @@ -709,17 +710,14 @@ install: $(wildcard *.go)
build: frontend backend

.PHONY: frontend
frontend: generate-frontend $(WEBPACK_DEST)
frontend: $(WEBPACK_DEST)

.PHONY: backend
backend: go-check generate-backend $(EXECUTABLE)

# We generate the backend before the frontend in case we in future we want to generate things in the frontend from generated files in backend
.PHONY: generate
generate: generate-backend generate-frontend

.PHONY: generate-frontend
generate-frontend: $(GO_LICENSE_FILE)
generate: generate-backend

.PHONY: generate-backend
generate-backend: $(TAGS_PREREQ) generate-go
Expand Down