-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add trimpath arg to gobuild * Add build constraints for trimpath usage * Reduce duplications across go versions * Change trimpath fn-files for better names * Attempt to apply with minikube on Travis * Attempt to apply with KinD on Travis * Install kind thru curl to not affect build
- Loading branch information
1 parent
a6277d0
commit be4e1ff
Showing
5 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,38 @@ | ||
sudo: false | ||
sudo: required | ||
|
||
dist: trusty | ||
|
||
services: | ||
- docker | ||
|
||
language: | ||
- go | ||
|
||
go: | ||
- "1.12" | ||
- "1.13" | ||
- '1.12' | ||
- '1.13' | ||
|
||
git: | ||
depth: 1 | ||
|
||
install: true | ||
install: true # skipping the default go dependencies install step | ||
|
||
before_script: | ||
# Download and install kubectl | ||
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ | ||
# Download and install KinD | ||
- curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.5.1/kind-$(uname)-amd64 && chmod +x ./kind && sudo mv kind /usr/local/bin/ | ||
# Create a new Kubernetes cluster using KinD | ||
- kind create cluster | ||
- export KUBECONFIG=$(kind get kubeconfig-path) | ||
|
||
script: | ||
# Verify that all source files are correctly formatted. | ||
- find . -name "*.go" | grep -v vendor/ | xargs gofmt -d -e -l | ||
|
||
- go clean -i | ||
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
|
||
- bash integration_test.sh | ||
# TODO: Set up coverage. | ||
#after_success: | ||
# - bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
go install ./cmd/ko | ||
ko apply -f ./cmd/ko/test -L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2018 Google LLC All Rights Reserved. | ||
// | ||
// 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. | ||
// | ||
// house flag adding function for go1.13 and later version with -trimpath available | ||
// +build go1.13 | ||
|
||
package build | ||
|
||
func addGo113TrimPathFlag(args []string) []string { | ||
return append(args, "-trimpath") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2018 Google LLC All Rights Reserved. | ||
// | ||
// 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. | ||
// | ||
// house placeholder function for go1.12 and earlier version without -trimpath | ||
// +build !go1.13 | ||
|
||
package build | ||
|
||
func addGo113TrimPathFlag(args []string) []string { | ||
return args | ||
} |