Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
refactor: check licenses in multiple modules
Browse files Browse the repository at this point in the history
  • Loading branch information
paralta committed Feb 6, 2024
1 parent 19adc81 commit f37b3d6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Vendor dependencies to retrieve licenses locally
# Vendor deps before running https://github.com/goph/licensei
# to avoid false-positives when modules GitHub repo could not be determined
run: go mod vendor
run: make gomod-vendor

- name: Check licenses
env:
Expand Down
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,29 @@ e2e: docker ## Run end-to-end test suite
cd e2e && \
go test -v -failfast -test.v -test.paniconexit0 -timeout 2h -ginkgo.v .

VENDORMODULES = $(addprefix vendor-, $(GOMODULES))

$(VENDORMODULES):
cd $(dir $(@:vendor-%=%)) && go mod vendor

.PHONY: gomod-vendor
gomod-vendor: $(VENDORMODULES) # Make vendored copy of dependencies for all modules

LICENSECHECKMODULES = $(GOMODULES)

$(LICENSECHECKMODULES):
cd $(dir $(@:license-check-%=%)) && "$(LICENSEI_BIN)" check --config "$(LICENSEI_CONFIG)"

.PHONY: license-check
license-check: bin/licensei license-cache ## Check licenses for software components
$(LICENSEI_BIN) check
license-check: bin/licensei license-cache $(LICENSECHECKMODULES) ## Check licenses for software components

LICENSECACHEMODULES = $(addprefix license-cache-, $(GOMODULES))

$(LICENSECACHEMODULES):
cd $(dir $(@:license-cache-%=%)) && "$(LICENSEI_BIN)" cache --config "$(LICENSEI_CONFIG)"

.PHONY: license-cache
license-cache: bin/licensei ## Generate license cache
$(LICENSEI_BIN) cache
+.PHONY: license-cache
license-cache: bin/licensei $(LICENSECACHEMODULES) ## Generate license cache

.PHONY: lint
lint: license-check lint-actions lint-bicep lint-cfn lint-go lint-helm ## Run all the linters
Expand Down
1 change: 1 addition & 0 deletions makefile.d/20-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
####

LICENSEI_BIN := $(BIN_DIR)/licensei
LICENSEI_CONFIG := $(ROOT_DIR)/.licensei.toml
LICENSEI_VERSION = 0.9.0

bin/licensei: bin/licensei-$(LICENSEI_VERSION)
Expand Down

0 comments on commit f37b3d6

Please sign in to comment.