Skip to content

Commit

Permalink
Add dep files to ensure reproducible builds
Browse files Browse the repository at this point in the history
Also removes tests that didn't do anything and replace
with a generate check.
  • Loading branch information
johanbrandhorst committed Aug 11, 2018
1 parent b235787 commit 97124e5
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
before_install:
- ./install-protobuf.sh
- PATH=/home/travis/bin:$PATH protoc --version
- go get github.com/gogo/protobuf/protoc-gen-gogo/descriptor
- go get github.com/gogo/protobuf/types
- go get github.com/gogo/protobuf/protoc-gen-gogotypes
- go get github.com/gogo/protobuf/gogoreplace
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure --vendor-only
- echo $TRAVIS_GO_VERSION

script:
- PATH=/home/travis/bin:$PATH make test
- PATH=/home/travis/bin:$PATH make regenerate
- git diff --exit-code

language: go

go:
- 1.9.x
- "1.9.x"
- "1.10.x"
- tip

53 changes: 53 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
required = [
"github.com/gogo/protobuf/gogoreplace",
]

[[constraint]]
name = "github.com/gogo/protobuf"
version = "1.1.1"

[prune]
go-tests = true
unused-packages = true
non-go = true
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
URL="https://raw.githubusercontent.com/googleapis/googleapis/master/"

test:
go test ./...

regenerate:
go install github.com/gogo/googleapis/protoc-gen-gogogoogleapis
go install ./protoc-gen-gogogoogleapis

protoc \
--gogogoogleapis_out=\
Expand All @@ -25,7 +22,7 @@ regenerate:
google/api/annotations.proto

update:
go install github.com/gogo/protobuf/gogoreplace
go install ./vendor/github.com/gogo/protobuf/gogoreplace

(cd ./google/rpc && rm status.proto; wget ${URL}/google/rpc/status.proto)
gogoreplace \
Expand Down Expand Up @@ -55,4 +52,4 @@ update:
gogoreplace \
'option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";' \
'option go_package = "api";' \
./google/api/annotations.proto
./google/api/annotations.proto
7 changes: 0 additions & 7 deletions google/api/api_test.go

This file was deleted.

7 changes: 0 additions & 7 deletions google/rpc/rpc_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions install-protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex

cd /home/travis

basename=protoc-3.5.1-linux-x86_64
wget https://github.com/google/protobuf/releases/download/v3.5.1/$basename.zip
basename=protoc-3.6.1-linux-x86_64
wget https://github.com/google/protobuf/releases/download/v3.6.1/$basename.zip
unzip $basename.zip

0 comments on commit 97124e5

Please sign in to comment.