Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a license-checking job #1326

Merged
merged 3 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ jobs:
- name: Check License Headers
uses: kt3k/[email protected]

licenses:
name: Dependency Licenses
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Check the licenses
run: make licensecheck

markdown-link-check:
name: Markdown Links (modified files)
runs-on: ubuntu-latest
Expand Down
22 changes: 22 additions & 0 deletions .lichen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Licenses other than Apache-2.0 are governed by
# https://github.com/cncf/foundation/blob/master/allowed-third-party-license-policy.md#approved-licenses-for-allowlist
# Note that Allowlist also requires that projects were created
# on GitHub at least 12 months prior and have at least 10 stars
# or 10 forks
allow:
- "Apache-2.0"
- "BSD-2-Clause"
- "BSD-2-Clause-FreeBSD"
- "BSD-3-Clause"
- "MIT"
- "ISC"
- "Python-2.0"
- "PostgreSQL"
- "X11"
- "Zlib"

# https://github.com/cncf/foundation/tree/master/license-exceptions
exceptions:
licenseNotPermitted:
- path: "github.com/hashicorp/golang-lru"
licenses: ["MPL-2.0"]
3 changes: 2 additions & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ ENV PROTOC_VERSION=3.15.5
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.5/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local && \
rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
GO111MODULE=off go get google.golang.org/protobuf/cmd/protoc-gen-go
GO111MODULE=off go get google.golang.org/protobuf/cmd/protoc-gen-go && \
GO111MODULE=off go get github.com/uw-labs/lichen

WORKDIR ${DAPPER_SOURCE}

Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,21 @@ comma := ,
# so "make images ARCHES=arm" will build a linux/arm/v7 image
ARCHES ?= amd64
BINARIES = submariner-gateway submariner-route-agent submariner-globalnet submariner-networkplugin-syncer
ARCH_BINARIES := $(foreach arch,$(subst $(comma),$(space),$(ARCHES)),$(foreach binary,$(BINARIES),bin/linux/$(call gotodockerarch,$(arch))/$(binary)))
IMAGES_ARGS = --platform $(subst $(space),$(comma),$(foreach arch,$(subst $(comma),$(space),$(ARCHES)),linux/$(call gotodockerarch,$(arch))))

build: $(foreach arch,$(subst $(comma),$(space),$(ARCHES)),$(foreach binary,$(BINARIES),bin/linux/$(call gotodockerarch,$(arch))/$(binary)))
build: $(ARCH_BINARIES)

licensecheck: BUILD_ARGS=--debug
licensecheck: $(ARCH_BINARIES)
lichen -c .lichen.yaml $(ARCH_BINARIES)

ci: validate unit build images

$(TARGETS): vendor/modules.txt
./scripts/$@

.PHONY: $(TARGETS) build ci images unit validate
.PHONY: $(TARGETS) build ci images unit validate licensecheck

else

Expand Down