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
third-party-notices:
name: Check third-party notices
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
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
@@ -1,3 +1,4 @@
*.swp
*.swo
*.test
/bin/
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DOCKER ?= docker
PCI_IDS_URL ?= https://pci-ids.ucw.cz/v2.2/pci.ids

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

Expand Down Expand Up @@ -84,6 +84,21 @@ coverage: test
update-pcidb:
wget $(PCI_IDS_URL) -O $(CURDIR)/pkg/pciids/default_pci.ids

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

$(GO_LICENSES): versions.mk
GOBIN=$(CURDIR)/bin GOFLAGS=-mod=mod 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