Skip to content

Commit 05f3a0e

Browse files
murphm8jchionh
authored andcommitted
Add .travis.yml with cross-compile support (#6)
1 parent 46f7a22 commit 05f3a0e

File tree

5 files changed

+61
-8
lines changed

5 files changed

+61
-8
lines changed

.travis.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
language: go
2+
sudo: false
3+
matrix:
4+
include:
5+
# "1.x" always refers to the latest Go version, inc. the patch release.
6+
# e.g. "1.x" is 1.11 until 1.11.1 is available.
7+
- go: 1.x
8+
env: LATEST=true GO111MODULE=on
9+
- go: 1.11.x
10+
env: GO111MODULE=on
11+
- go: tip
12+
env: GO111MODULE=on
13+
allow_failures:
14+
- go: tip
15+
16+
before_install:
17+
# gox simplifies building for multiple architectures
18+
- go get github.com/mitchellh/gox
19+
- go get github.com/golang/mock/gomock
20+
- go install github.com/golang/mock/mockgen
21+
22+
install:
23+
- # skip
24+
25+
script:
26+
- diff -u <(echo -n) <(gofmt -d .)
27+
- go build ./...
28+
- go generate ./...
29+
- go test -v -race ./...
30+
# Only build binaries from the latest Go release.
31+
- if [ "${LATEST}" = "true" ]; then gox -osarch="darwin/amd64 windows/amd64 linux/amd64 linux/arm" -output="bundle-helper.{{.OS}}.{{.Arch}}" -verbose ./cmd/cli; fi
32+
33+
deploy:
34+
provider: releases
35+
skip_cleanup: true
36+
api_key:
37+
# Your *encrypted* GitHub key, as the output of the Travis CI CLI tool.
38+
secure: "uaw5aOap5ZFqBKBGNf4l4dh0o7uaECiKAdUAgab0DaFz6ZDOXPoSuhYD3/8U8es5gshYex0D03vyPIis+I/KW0+dX6P4RO8sWQbR6zdOcHPxo3SLBc/KB5X8jxCmOCFPGuEPRS1zIMZ4L5z+iMQCv96LXT/Nl8pnmELH4wR3y+Ppw4a5mRY3zjxxLM9ksKdO/4aDKQFEOpIMM5nszRT4uKVwdqcjBHdnC7YrHCXIHXTD5HlqTnMXlGNLXMWps7hvwaAY+SdkAobf3K9iVs7EuFVUAKfA3ZCwcoFg/AtopcF/dLADVlnzJyBWJLJBXqQ+0n2QZ1NZnLaZA8exIFWwkohWT9Da4QlsuD8HIdsShIqYWsNSh6dxI7zmXhL4GiLTQzCWb1gvVTyVyPvpwei0dG8mPBXIvFoZlC+aYy5jyY27gUQ6YSwAw6JSTv08yKBT1kSNmCvLz43BJyaR20ggzs/6ORYRKP6jw0+MzAqrT5jMiOOMlwHx3Pq2m/ucuS8yNeiO4fXzaWgJGbsPCCqPiR++7usRrrGFaoUWVKJnLmsjqkWkPmv348iMNvofq9yCVIQeUJ79yh0unG/meVpNySSg6qJ+xlna1Z1KAKn0PrSaTJXRyB/eynyHINOAhkaZGrmbKAk8A9+CK80+1yziSIBKkVUWijBRVf20EKQHKfg="
39+
file:
40+
# The names of the binaries to output, based on the -output template passed to gox.
41+
- bundle-helper.windows.amd64.exe
42+
- bundle-helper.darwin.amd64
43+
- bundle-helper.linux.amd64
44+
- bundle-helper.linux.arm
45+
on:
46+
# What to repository to build
47+
repo: aws-robotics/aws-robomaker-bundle-support-library
48+
# Only build binaries for tagged commits
49+
tags: true
50+
condition: $LATEST = true

cmd/cli/main.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ import (
1212
"github.com/urfave/cli"
1313
)
1414

15-
1615
func main() {
1716
app := cli.NewApp()
1817
app.Name = "Bundle Info"
1918
app.Usage = "Get source command for bundle"
20-
app.Flags = []cli.Flag {
19+
app.Flags = []cli.Flag{
2120
cli.StringFlag{Name: "bundle", Value: "", Usage: "Path to bundle file"},
2221
cli.StringFlag{Name: "prefix", Value: "", Usage: "Prefix to put onto the source command"},
2322
}
@@ -53,14 +52,11 @@ func main() {
5352
log.Fatal(err)
5453
return err
5554
}
56-
for i := 0; i < len(b.PosixSourceCommands()); i++ {
55+
for i := 0; i < len(b.PosixSourceCommands()); i++ {
5756
fmt.Print(b.PosixSourceCommandsUsingLocation(prefix_path)[i])
5857
}
5958

6059
return nil
6160
}
6261
app.Run(os.Args)
6362
}
64-
65-
66-

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
module github.com/aws-robotics/aws-robomaker-bundle-support-library
22

3-
go 1.12
3+
go 1.11
44

55
require (
66
github.com/aws/aws-sdk-go v1.19.11
77
github.com/golang/mock v1.2.0
88
github.com/google/uuid v1.1.1
9+
github.com/mitchellh/gox v1.0.0 // indirect
910
github.com/stretchr/testify v1.3.0
1011
github.com/urfave/cli v1.20.0
1112
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 // indirect

go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk=
66
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
77
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
88
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
9+
github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8=
10+
github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
911
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
1012
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
13+
github.com/mitchellh/gox v1.0.0 h1:7ENCygwtc/7barDq96k0JPZhvrpHO/7oihNahmrmAhg=
14+
github.com/mitchellh/gox v1.0.0/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4=
15+
github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=
16+
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
1117
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1218
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1319
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

pkg/bundle/bundle_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
testRootPath = "/testing_root"
15+
testRootPath = "/testing_root"
1616
containerRootPath = "/container_root"
1717
)
1818

0 commit comments

Comments
 (0)