Skip to content

Commit

Permalink
Update SDK's CI to ensure Go packages all compile (#1102)
Browse files Browse the repository at this point in the history
Ensures all packages that are not excluded via build tags have non-test Go files in them. This ensures other CI tasks such as `go install` do not fail due to missing non-test Go files.
  • Loading branch information
jasdel authored Feb 2, 2021
1 parent af489c3 commit e5e313f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ matrix:
- go: tip

include:
- language: go
os: linux
go: 1.15.x
script:
- make go-build-modules-.

- language: go
os: windows
go: 1.15.x
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ tidy-modules-%:
@# module testing will start from. Strips off the "tidy-modules-" and
@# replaces all "_" with "/".
@#
@# e.g. build-modules-internal_protocoltest
@# e.g. tidy-modules-internal_protocoltest
cd ./internal/repotools/cmd/eachmodule \
&& go run . -p $(subst _,/,$(subst tidy-modules-,,$@)) ${EACHMODULE_FLAGS} \
"go mod tidy"
Expand Down Expand Up @@ -183,6 +183,18 @@ build-modules-%:
&& go run . -p $(subst _,/,$(subst build-modules-,,$@)) ${EACHMODULE_FLAGS} \
"go test ${BUILD_TAGS} ${RUN_NONE} ./..."

go-build-modules-%:
@# build command that uses the pattern to define the root path that the
@# module testing will start from. Strips off the "build-modules-" and
@# replaces all "_" with "/".
@#
@# Validates that all modules in the repo have buildable Go files.
@#
@# e.g. go-build-modules-internal_protocoltest
cd ./internal/repotools/cmd/eachmodule \
&& go run . -p $(subst _,/,$(subst go-build-modules-,,$@)) ${EACHMODULE_FLAGS} \
"go build ${BUILD_TAGS} ./..."

test: test-modules-.

test-race-modules-%:
Expand Down
3 changes: 3 additions & 0 deletions service/ec2/internal/customizations/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package customizations provides the implementation of customizations for
// the ec2 module.
package customizations
2 changes: 2 additions & 0 deletions service/s3/internal/configtesting/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package configtesting provides unit testing of s3 module's config loading.
package configtesting

0 comments on commit e5e313f

Please sign in to comment.