From f3229be14198a1e620ab932a80c109e8c3b57c18 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Mon, 31 Jan 2022 16:16:53 -0500 Subject: [PATCH] Check headers in CI Using a fork of addlicense until https://github.com/google/addlicense/pull/104 merges --- .github/workflows/porch.yml | 4 ++-- porch/Makefile | 14 ++++++++++++++ porch/controllers/Makefile | 14 ++++++++++++++ porch/controllers/remoterootsync/Makefile | 14 ++++++++++++++ porch/repository/doc.go | 14 ++++++++++++++ 5 files changed, 58 insertions(+), 2 deletions(-) diff --git a/.github/workflows/porch.yml b/.github/workflows/porch.yml index 6bc7f83b92..500993b90e 100644 --- a/.github/workflows/porch.yml +++ b/.github/workflows/porch.yml @@ -38,9 +38,9 @@ jobs: - name: Build server run: make porch working-directory: ./porch - - name: Build controllers + - name: Run CI run: make ci - working-directory: ./porch/controllers + working-directory: ./porch - name: Test run: make test working-directory: ./porch diff --git a/porch/Makefile b/porch/Makefile index eb3222dead..4e26d14a2f 100644 --- a/porch/Makefile +++ b/porch/Makefile @@ -104,3 +104,17 @@ run-jaeger: .PHONY: porch porch: cd apiserver; go build ./cmd/porch + +.PHONY: verify-headers +verify-headers: + # TODO: switch to google/addlicense once we have https://github.com/google/addlicense/pull/104 + go run github.com/justinsb/addlicense@v1.0.1 -c "Google LLC" -l apache --check --ignore ".build/**" . + +.PHONY: fix-headers +fix-headers: + # TODO: switch to google/addlicense once we have https://github.com/google/addlicense/pull/104 + go run github.com/justinsb/addlicense@v1.0.1 -c "Google LLC" -l apache --ignore ".build/**" . + +.PHONY: ci +ci: verify-headers + make -C controllers ci \ No newline at end of file diff --git a/porch/controllers/Makefile b/porch/controllers/Makefile index 0654d899c3..3b3b8de582 100644 --- a/porch/controllers/Makefile +++ b/porch/controllers/Makefile @@ -1,3 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + .PHONY: build build: cd remoterootsync; go build . diff --git a/porch/controllers/remoterootsync/Makefile b/porch/controllers/remoterootsync/Makefile index 062281182b..3bef1be8bb 100644 --- a/porch/controllers/remoterootsync/Makefile +++ b/porch/controllers/remoterootsync/Makefile @@ -1,3 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # GCP project to use for development GCP_PROJECT_ID ?= $(shell gcloud config get-value project) diff --git a/porch/repository/doc.go b/porch/repository/doc.go index 50a4378d50..9986d02945 100644 --- a/porch/repository/doc.go +++ b/porch/repository/doc.go @@ -1 +1,15 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package repository