You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-09-16 09:26:25 +02:00
Add toolchain check (#5983)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5660 Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
- name: Generate
|
||||
run: make generate
|
||||
- name: Run linters
|
||||
run: make license-check lint vanity-import-check verify-readmes verify-mods
|
||||
run: make toolchain-check license-check lint vanity-import-check verify-readmes verify-mods
|
||||
- name: Build
|
||||
run: make build
|
||||
- name: Check clean repository
|
||||
|
14
Makefile
14
Makefile
@@ -14,8 +14,8 @@ TIMEOUT = 60
|
||||
.DEFAULT_GOAL := precommit
|
||||
|
||||
.PHONY: precommit ci
|
||||
precommit: generate license-check misspell go-mod-tidy golangci-lint-fix verify-readmes verify-mods test-default
|
||||
ci: generate license-check lint vanity-import-check verify-readmes verify-mods build test-default check-clean-work-tree test-coverage
|
||||
precommit: generate toolchain-check license-check misspell go-mod-tidy golangci-lint-fix verify-readmes verify-mods test-default
|
||||
ci: generate toolchain-check license-check lint vanity-import-check verify-readmes verify-mods build test-default check-clean-work-tree test-coverage
|
||||
|
||||
# Tools
|
||||
|
||||
@@ -235,6 +235,16 @@ govulncheck/%: $(GOVULNCHECK)
|
||||
codespell: $(CODESPELL)
|
||||
@$(DOCKERPY) $(CODESPELL)
|
||||
|
||||
.PHONY: toolchain-check
|
||||
toolchain-check:
|
||||
@toolchainRes=$$(for f in $(ALL_GO_MOD_DIRS); do \
|
||||
awk '/^toolchain/ { found=1; next } END { if (found) print FILENAME }' $$f/go.mod; \
|
||||
done); \
|
||||
if [ -n "$${toolchainRes}" ]; then \
|
||||
echo "toolchain checking failed:"; echo "$${toolchainRes}"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
.PHONY: license-check
|
||||
license-check:
|
||||
@licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path '**/third_party/*' ! -path './.git/*' ) ; do \
|
||||
|
Reference in New Issue
Block a user