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

Commit f37b3d6

Browse files
committed
refactor: check licenses in multiple modules
1 parent 19adc81 commit f37b3d6

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/workflows/reusable-verification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Vendor dependencies to retrieve licenses locally
4646
# Vendor deps before running https://github.com/goph/licensei
4747
# to avoid false-positives when modules GitHub repo could not be determined
48-
run: go mod vendor
48+
run: make gomod-vendor
4949

5050
- name: Check licenses
5151
env:

Makefile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,29 @@ e2e: docker ## Run end-to-end test suite
149149
cd e2e && \
150150
go test -v -failfast -test.v -test.paniconexit0 -timeout 2h -ginkgo.v .
151151

152+
VENDORMODULES = $(addprefix vendor-, $(GOMODULES))
153+
154+
$(VENDORMODULES):
155+
cd $(dir $(@:vendor-%=%)) && go mod vendor
156+
157+
.PHONY: gomod-vendor
158+
gomod-vendor: $(VENDORMODULES) # Make vendored copy of dependencies for all modules
159+
160+
LICENSECHECKMODULES = $(GOMODULES)
161+
162+
$(LICENSECHECKMODULES):
163+
cd $(dir $(@:license-check-%=%)) && "$(LICENSEI_BIN)" check --config "$(LICENSEI_CONFIG)"
164+
152165
.PHONY: license-check
153-
license-check: bin/licensei license-cache ## Check licenses for software components
154-
$(LICENSEI_BIN) check
166+
license-check: bin/licensei license-cache $(LICENSECHECKMODULES) ## Check licenses for software components
167+
168+
LICENSECACHEMODULES = $(addprefix license-cache-, $(GOMODULES))
169+
170+
$(LICENSECACHEMODULES):
171+
cd $(dir $(@:license-cache-%=%)) && "$(LICENSEI_BIN)" cache --config "$(LICENSEI_CONFIG)"
155172

156-
.PHONY: license-cache
157-
license-cache: bin/licensei ## Generate license cache
158-
$(LICENSEI_BIN) cache
173+
+.PHONY: license-cache
174+
license-cache: bin/licensei $(LICENSECACHEMODULES) ## Generate license cache
159175

160176
.PHONY: lint
161177
lint: license-check lint-actions lint-bicep lint-cfn lint-go lint-helm ## Run all the linters

makefile.d/20-tools.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
####
44

55
LICENSEI_BIN := $(BIN_DIR)/licensei
6+
LICENSEI_CONFIG := $(ROOT_DIR)/.licensei.toml
67
LICENSEI_VERSION = 0.9.0
78

89
bin/licensei: bin/licensei-$(LICENSEI_VERSION)

0 commit comments

Comments
 (0)