Skip to content

Commit

Permalink
Added check for toolchain
Browse files Browse the repository at this point in the history
Signed-off-by: 7h3-3mp7y-m4n <emailtorash@gmail.com>
  • Loading branch information
7h3-3mp7y-m4n committed Nov 18, 2024
1 parent 1dcb2c0 commit 0da0928
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Generate
run: make generate
- name: Run linters
run: make license-check lint vanity-import-check
run: make toolchain-check lint vanity-import-check
- name: Build
run: make build
- name: Check clean repository
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ TIMEOUT = 60
.DEFAULT_GOAL := precommit

.PHONY: precommit ci
precommit: generate license-check misspell go-mod-tidy golangci-lint-fix test-default
ci: generate license-check lint vanity-import-check 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

Expand Down Expand Up @@ -189,6 +189,16 @@ vanity-import-check: | $(PORTO)
.PHONY: lint
lint: go-mod-tidy golangci-lint misspell govulncheck

.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 './vendor/*' ! -path './exporters/otlp/internal/opentelemetry-proto/*') ; do \
Expand Down

0 comments on commit 0da0928

Please sign in to comment.