Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,19 @@ jobs:
with:
go-version: ${{ env.GOLANG_VERSION }}
- run: make build
check-third-party-notices:
name: Check third-party notices
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
name: Checkout code
- name: Get Golang version
id: vars
run: |
GOLANG_VERSION=$( grep "GOLANG_VERSION ?=" versions.mk )
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GOLANG_VERSION }}
- run: make check-third-party-notices
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include $(CURDIR)/versions.mk
DOCKERFILE_DEVEL := "images/devel/Dockerfile"
K8S_TEST_INFRA := "https://github.com/NVIDIA/k8s-test-infra.git"

TARGETS := binary build all check fmt assert-fmt generate test coverage golangci-lint
TARGETS := binary build all check fmt assert-fmt generate test coverage golangci-lint third-party-notices check-third-party-notices
DOCKER_TARGETS := $(patsubst %, docker-%, $(TARGETS))
.PHONY: $(TARGETS) $(DOCKER_TARGETS)

Expand Down Expand Up @@ -70,6 +70,21 @@ vendor:
check-vendor: vendor
git diff --quiet HEAD -- go.mod go.sum vendor

GO_LICENSES = $(CURDIR)/bin/go-licenses

$(GO_LICENSES): versions.mk
GOBIN=$(CURDIR)/bin GOFLAGS= go install github.com/google/go-licenses/v2@$(GO_LICENSES_VERSION)

third-party-notices: $(GO_LICENSES)
@bash hack/generate-third-party-notices.sh

check-third-party-notices: third-party-notices
@echo "- Checking if THIRD_PARTY_NOTICES.md is up to date..."
@git ls-files --error-unmatch THIRD_PARTY_NOTICES.md >/dev/null 2>&1 \
|| { echo "ERROR: THIRD_PARTY_NOTICES.md is not tracked. Run 'make third-party-notices' and commit the result."; exit 1; }
@git diff --exit-code -- THIRD_PARTY_NOTICES.md \
|| { echo "ERROR: THIRD_PARTY_NOTICES.md is stale. Run 'make third-party-notices' and commit the change."; exit 1; }

build-image: $(DOCKERFILE_DEVEL)
$(DOCKER) build \
--progress=plain \
Expand Down
Loading