Skip to content

Commit

Permalink
Merge pull request #1863 from saschagrunert/verify-build
Browse files Browse the repository at this point in the history
Add verify-build step to make target
  • Loading branch information
k8s-ci-robot authored Jan 21, 2021
2 parents 8a27364 + 4be32f1 commit f680678
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ verify-published-rpms: ## Ensure rpms have been published

##@ Verify

.PHONY: verify verify-boilerplate verify-dependencies verify-golangci-lint verify-go-mod verify-shellcheck
.PHONY: verify verify-boilerplate verify-build verify-dependencies verify-golangci-lint verify-go-mod verify-shellcheck

# TODO: Uncomment verify-shellcheck once we finish shellchecking the repo.
# ref: https://github.com/kubernetes/release/issues/726
verify: release-tools verify-boilerplate verify-dependencies verify-golangci-lint verify-go-mod #verify-shellcheck ## Runs verification scripts to ensure correct execution
verify: release-tools verify-boilerplate verify-build verify-dependencies verify-golangci-lint verify-go-mod #verify-shellcheck ## Runs verification scripts to ensure correct execution

verify-boilerplate: ## Runs the file header check
./hack/verify-boilerplate.sh

verify-build: ## Builds the project for a chosen set of platforms
./hack/verify-build.sh

verify-dependencies: ## Runs zeitgeist to verify dependency versions
./hack/verify-dependencies.sh

Expand Down
40 changes: 40 additions & 0 deletions hack/verify-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

# Copyright 2021 The Kubernetes Authors.
#
# 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.

set -o errexit
set -o nounset
set -o pipefail

PLATFORMS=(
linux/amd64
linux/386
linux/arm
linux/arm64
linux/ppc64le
linux/s390x
windows/amd64
windows/386
freebsd/amd64
darwin/amd64
)

for PLATFORM in "${PLATFORMS[@]}"; do
OS="${PLATFORM%/*}"
ARCH=$(basename "$PLATFORM")

echo "Building project for $PLATFORM"
GOARCH="$ARCH" GOOS="$OS" go build ./...
done

0 comments on commit f680678

Please sign in to comment.